gpt4 book ai didi

javascript - Jquery 取消绑定(bind)与 one() 绑定(bind)的事件

转载 作者:可可西里 更新时间:2023-11-01 01:59:53 24 4
gpt4 key购买 nike

有什么方法可以解绑已经被one()绑定(bind)的事件吗?有点像 unone()

最佳答案

引自 JQuery.com:

You cannot unbind a listener created using .one(). If you want to be able to unbind something that has to occur only once but still be able to unbind it before it occurs, you have to use .bind()

类似于:

$("#element").on("click",function(event){
//do stuff here
$(this).off(event);
}

关于javascript - Jquery 取消绑定(bind)与 one() 绑定(bind)的事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7195052/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com