我需要覆盖事件,但是,应用程序可以选择将原始事件返回到文档的每个元素。有什么想法吗?
例如:
<div class="mydiv">
</div>
$(document).delegate( '.mydiv', click', function () {
alert('This is the original event my event!');
});
$(document).delegate( '.mydiv', 'click', function() {
alert('Do this and ignore de previous...');
// For example: How to return the original event when mouseleave event will executed?
});
$(document).delegate( '.mydiv', 'mouseleave', function() {
// return the original event of mydiv
});
答案 0 :(得分:1)
答案 1 :(得分:0)
尝试检查函数中的单击事件
$(document).delegate('。mydiv',click',function() {
if(clicked){
return;
}
alert('This is the original event my event!');
});
$(document).delegate( '.mydiv', 'click', function() {
if(!clicked){
return;
}
alert('Do this and ignore de previous...');
});