jQuery 可拖动错误 : Object doesn't support this property or method

标签 jquery

我正在尝试将可拖动对象添加到简单的 html 页面。

IE 给出:对象不支持此属性或方法

FF 给出: jQuery(".dragthis").draggable 不是一个函数

使用最新的jquery解压。 这是代码:

<html> 
    <head>
        <script src="jquery.js"></script>
        <script>
            $(document).ready(function () {
                jQuery(".dragthis").draggable();
                jQuery(".drophere").droppable();

            });
        </script>
        <style>
            .dragthis {
            }
            .drophere {
            }
        </style>
    </head>

    <body>
        <div class="dragthis">dragthis</div>
        <div class="drophere">drophere</div>
    </body> 
</html>

我做错了什么?

最佳答案

您需要包含 jQuery UI library .

关于jQuery 可拖动错误 : Object doesn't support this property or method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/292635/

相关文章:

jquery - 如何防止共享主机上的 IIS 应用程序池空闲超时

cordova - 当我点击按钮时,它会触发两次(在手机中)(jquery+phonegap)

javascript - jQuery 在 find() 选择器中动态使用当前域

php - 通过 VPN 剥离请求数据的 AJAX Post 请求

javascript - HTML 类的 jQuery .each() 迭代 - 定义了依赖于订单类的不一致行为

javascript - 根据窗口大小自动调整高度大小,使按钮充满空间

javascript - 让文字脉动 jQuery

javascript - 如何在 Bootstrap 下拉列表中将 JavaScript 函数设置为 onchange 操作?

jquery - 多个 Ajax 调用

jquery 简单的幻灯片