jQuery中的事件处理(移除绑定)

1.bind移除事件:

  unbind() 方法移除被选元素的事件处理程序。

  语法:

    $(selector).unbind(event)

2.delegate移除事件:

  undelegate() 方法移除一个或多个由 delegate() 方法添加的事件处理程序。

  语法:

    $(selector).undelegate(selector,event)

3.on移除事件:

  off() 方法通常用于移除通过 on() 方法添加的事件处理程序。

  语法:

    $(selector).off(event,selector)

猜你喜欢

转载自www.cnblogs.com/abner-pan/p/12897318.html