jQuery Sortable-禁用onclick =& quot;& quot;在排序时 [英] Jquery Sortable - Disable onclick="" while sorting
本文介绍了jQuery Sortable-禁用onclick =& quot;& quot;在排序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在排序时禁用onclick ="?
is it possible to disable onclick="" while sorting?
我在这里有一个有效的示例 http://www.jsfiddle.net/V9Euk/59/
I Have a working example here http://www.jsfiddle.net/V9Euk/59/
彼得
推荐答案
如果您不想使用@nigative的flag变量来完成此操作,则可以使用start和stop方法执行以下操作:
If you don't want to do it with a flag variable as per @nigative , you can do the following with the start and stop methods:
$("#lop").sortable({
revert: '100',
placeholder: 'auo',
start: function(event, ui) {
ui.item[0].oldclick = ui.item[0].onclick;
ui.item[0].onclick = null;
},
stop: function(event, ui) {
ui.item[0].onclick = ui.item[0].oldclick;
}
});
这篇关于jQuery Sortable-禁用onclick =& quot;& quot;在排序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文