我有这段代码,但它使用的是一个旧的遗留函数"livequery“,它真的应该切换到使用"on”。然而,对于我的生活来说,我不能让它工作。这是我的代码片段。
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;
}
});
});
这不起作用,因为我猜"draggable“不是事件名称...
谢谢..
发布于 2012-10-10 13:42:18
这里的答案是New Inserted dom node可以帮助你将你的代码转换成on函数而不是live function
https://stackoverflow.com/questions/12332482
复制相似问题