2011-06-27 107 views
1

我们使用而使用拖放和jQuery UI的拖放操作给错误

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js" type="text/javascript"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script> 
<script src="js/mousewheel.js" type="text/javascript"></script> 
<script src="js/scrollpane.js" type="text/javascript"></script> 
<script src="js/fancybox.js" type="text/javascript"></script> 
<script src="js/tabs/js/tabs.js" type="text/javascript"></script> 
<script src="js/jquery.tipsy.js" type="text/javascript"></script> 

,当我尝试使用拖放

$("#move").draggable(); 
$("#pp-you").droppable({ 
    drop: function() { alert('dropped'); } 
}); 

,当我尝试拖动它给这个错误

$.widget.prototype._trigger is undefined 
return $.widget.prototype._trigger.call(this, type, event, ui); 

回答

0

你应该尝试用Firebug检查你的HTML/Javascript。

$("#move").draggable(); 
 

 
$("#pp-you").droppable({ 
 
    drop: function() { 
 
    alert('dropped'); 
 
    } 
 
});
#move { 
 
    width: 100px; 
 
    height: 100px; 
 
    background-color: red; 
 
} 
 
#pp-you { 
 
    width: 100px; 
 
    height: 100px; 
 
    background-color: green; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script> 
 

 
<div id="move">try to move me</div> 
 
<div id="pp-you">drop stuff here</div>

我创建了一个fiddle,似乎很好地工作。

+0

我认为问题是与js文件 – XMen

+0

问题是与tab.js文件 – XMen

+0

@Rahul Mehta:对!我不太了解这个tab.js文件,所以,我害怕,我无法帮助。 – LeftyX