Javascript 在指定新事件时,如何在jquery中避免并返回事件?
我需要覆盖事件,但应用程序可以选择将原始事件返回到文档的每个元素。有什么想法吗 例如:Javascript 在指定新事件时,如何在jquery中避免并返回事件?,javascript,jquery,events,event-handling,Javascript,Jquery,Events,Event Handling,我需要覆盖事件,但应用程序可以选择将原始事件返回到文档的每个元素。有什么想法吗 例如: <div class="mydiv"> </div> $(document).delegate( '.mydiv', click', function () { alert('This is the original event my event!'); }); $(document).delegate( '.mydiv',
<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
});
$(document).delegate('.mydiv',click',function(){
警报('这是原始事件我的事件!');
});
$(文档).delegate('.mydiv',click',function(){
警报('执行此操作并忽略de PREVICE…');
//例如:当mouseleave事件执行时,如何返回原始事件?
});
$(document).delegate('.mydiv',mouseleave',function(){
//返回mydiv的原始事件
});
在创建新建功能之前,请使用取消删除功能
文档尝试检查函数中的单击事件
$(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...');
});