用.off()替换.unbind() [英] Replace .unbind() with .off()

查看:59
本文介绍了用.off()替换.unbind()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery 1.9.该如何重写以将.unbind()替换为.off()?

I am using jQuery 1.9. How can this be rewritten to replace .unbind() with .off()?

$span_rename_folder.children().children(':image.inplace_cancel').unbind('click').click(function(){

推荐答案

$span_rename_folder
    .children()
    .children(':image.inplace_cancel')
    .off('click')
    .on('click', function(){...});

这将从选定元素中删除所有点击事件.

That will remove all click events from the selected element.

这篇关于用.off()替换.unbind()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆