【发布时间】:2012-09-08 16:29:01
【问题描述】:
我有这段代码,但它使用的是旧的遗留函数“livequery”,应该真正切换到使用“on”。但是,对于我的生活,我无法让它发挥作用。 这是我的代码 sn-p。
jQuery('.box').livequery(function(){
jQuery('a', this).click(function() {
return false;
});
jQuery(this).draggable({
appendTo: "body",
helper: 'clone',
opacity: 0.5,
zIndex: 900,
stop: function(event, ui) {
return true;
}
});
});
我试过这个...
jQuery('.box').on('draggable', function(){
jQuery('a', this).click(function() {
return false;
});
jQuery(this).draggable({
appendTo: "body",
helper: 'clone',
opacity: 0.5,
zIndex: 900,
stop: function(event, ui) {
return true;
}
});
});
这不起作用,因为我猜“可拖动”不是事件名称...
谢谢..
【问题讨论】:
-
livequery != live,因此将使用livequery的代码转为使用on可能没有意义。
标签: jquery jquery-ui livequery jquery-on