2012-04-07 27 views
1

有人能幫我嗎?它可能是一些簡單的我俯瞰:簡單的jquery draggable不適合我嗎?

<script src="http://jqueryui.com/ui/jquery.ui.core.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.mouse.js"></script> 
<script src="http://jqueryui.com/ui/jquery.ui.draggable.js"></script> 


<script> 
$(function() { 
    $("#draggable").draggable(); 
}); 
</script> 



<div id="draggable" class="ui-widget-content" 
style="position:absolute;width:150px;height:210px;left:2%;top:40%;background-color:#eeeeee;border-radius:12px;border:solid 1px black;font-size:17px;text-align:center"> 
</div> 


http://jqueryui.com/demos/draggable/#default

回答

3

您的網址被打破;如果我加載整個jQuery UI庫,你的代碼工作here

+0

哇,謝謝,我從來沒有抓住這些粗心的錯誤讓自己驚訝!我需要睡覺哈哈...... – 2012-04-07 15:20:40

+0

錯,你需要咖啡。 =) – 2012-04-07 15:21:08

1

我認爲你沒有添加到您的網頁的jquery.js

在其他腳本標籤的頂部添加這一行,

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> 

jsfiddle example(外部的jQuery)的作品