繁体   English   中英

如何删除具有不同事件参数的事件侦听器?

[英]How to remove an event listener with different event parameter?

我有一个使用“mousemove”参数发生的事件监听器:

currentCardEl.addEventListener("mousemove", updateCard);

我可以使用 removeEventListener 和另一个参数来删除这个 function 吗?

currentCardEl.removeEventListener("mouseleave", updateCard, true);

你可以做到这一点,当你不想做这个事件时,满足一个 sertian 条件。 否则不确定

temp.addEventListner(MouseEvent.CLICK, thisIsTheFunction);

function thisIsTheFunction(evt:MouseEvent){
   if(){ //Here you have the condition

   }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM