我有一个工作应用程序,它使用 jquery ui 对话框。我想让对话框可拖动。据我所知,唯一需要的是 jquery.ui.draggable.js 脚本。所以我将它添加到我正在使用的脚本中,但知道我收到以下错误(如 Firebug 控制台所示):base is not a constructor jquery.ui.widget.js 中的相关行是:
var basePrototype = new base();
这就是我添加所有脚本的方式:
<script type="text/javascript" src="/media/development-bundle/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.draggable.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="/media/development-bundle/ui/jquery.ui.dialog.js"></script>
我做错了什么吗?或者这是 jquery 的问题?
在此先感谢您的帮助
最佳答案
问题是 draggable 扩展了 $.ui,mouse,它包含在 UI 1.7x 的 ui 核心文件中。
您需要在可拖动之前包含 jquery.ui.mouse.js,这将解决问题。
关于javascript - jQuery.ui.draggable.js 和 jQuery.ui.widget.js 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2594579/