我很新JQuery
,我正在尝试使用 Draggable 插件创建一个示例页面。页面加载正常,但我无法将我的<div>
标签拖到任何地方。我一直在尝试复制这个演示。这是我的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<style type="text/css">
#draggable { width: 150px; height: 150px; padding: 0.5em; border: solid 1px black; cursor:pointer;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<script src="scripts/jquery.js" type="text/javascript"/>
<script src="scripts/jquery.ui.core.js" type="text/javascript"/>
<script src="scripts/jquery.ui.draggable.js" type="text/javascript"/>
<script src="scripts/jquery.ui.mouse.js" type="text/javascript"/>
<script src="scripts/jquery.ui.widget.js" type="text/javascript"/>
<script src="scripts/jquery-ui-1.8.13.custom.js" type="text/javascript" />
<script type="text/javascript">
$(document).ready(function() {
$("#draggable").draggable();
});
</script>
<div class="demo" style="height: 500px; width: 500px;">
<div id="draggable">
<p>Drag me around</p>
</div>
</div>
</div>
</form>
</body>
</html>
我只是想做到这一点,这样我就可以在它<div>
周围的“演示”中拖动我的“可拖动” <div>
。谁能看到我错过了什么?