如果我将事件处理程序与one()
绑定(我只希望它运行一次),那么在事件处理程序完成后,我是否仍需要与off()
解除绑定?
$(el).one('transitionend', function(e){
$(el).off('transitionend'); is this necessary?
});
最佳答案
不,根本不需要$.off()
。一旦事件触发一次,就将处理程序移除。