我以前使用过.draggable()函数,而且它在前一次工作得很好。然而,这一次,它甚至不起作用。我不知道为什么?
这些是我的jQuery链接
<script src="https://code.jquery.com/jquery-2.1.1.js"></script>
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<link rel="stylesheet" href="https//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">这是我的HTML
<div class="mainArea" id="response">
<div class="designer">
<?php include"shirtBasic.svg" ?>
<div id="imageDiv"> </div>
<div id="dragDiv"> </div>
</div>
<table width="100%" border="0" id="sizeBar">
<tr>
<td class="leftBarButton" style="width:50%">Front</td>
<td class="leftBarButton" style="width:50%">Back</td>
</tr>
</table>
</div>这是jQuery
$(document).ready(function() {
$(function() {
$('#dragDiv').draggable();
});
});这不是唯一的代码,在HTML和jQuery上面和下面也有其他代码,但不相关。
请帮我找出问题,并建议我是否链接了正确的版本的jQuery,如果有新的可用请启发我。
发布于 2014-08-29 19:32:08
你的代码运行良好..。http://jsfiddle.net/m6ac80wb/2/
您应该只使用一个版本的JQUERY。您可以保留最新的https://code.jquery.com/jquery-2.1.1.js
另外,不要忘记在导入jquery-2.1.1.js 之前导入jquery-ui.js。
发布于 2014-08-29 19:50:40
您可以尝试使用:
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">如果您这样做的话,它就能工作,而且您的样式表也遗漏了":“在url中,这并不是它不起作用的原因,但我想我应该指出它。
https://stackoverflow.com/questions/25574956
复制相似问题