我想对元素执行单击,同时阻止同一元素上的其他处理程序触发。
//Calling this
$(".element").click();
但是,我想调用stopImmediatePropogation();
//I want something like this, doesn't seem to work
$(".element").click(function(e) {
//stop other handlers from firing
e.stopImmediatePropagation()
});
$(".element").on("click", function(){
//this will fire with the previous click.
//I don't want it to fire.
});
但点击似乎没有任何参数(我可以看到)。有没有办法做到这一点?