使用jQuery删除Item的OnDblClick事件 [英] Remove OnDblClick Event on Item using jQuery

查看:116
本文介绍了使用jQuery删除Item的OnDblClick事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上的项目上附加了以下代码:

I have the following code attached to an item on a web page:

(function(){
  var vName = $("#NAME").substr(2);
  $("#NAME").ondblclick   = new Function("vName+".remove();");
  $("#NAME_2").ondblclick = new Function("processMove();");
})();

这么多的代码不是问题,但是我想通过jQuery进行的操作是删除对该项目执行"ondblclick"的功能,即希望删除此功能或双击该项目总而言之,仅针对特定条件,对于这个问题,这又不重要.

The code so much is not an issue but what I would like to do, via jQuery is to remove the ability to perform a "ondblclick" on this item, i.e., would like to remove this function or double clicks on this item altogether, only for a particular criteria, which again is not important as part of this question.

推荐答案

只需.unbind()它:

$('selector').unbind('dblclick');

这篇关于使用jQuery删除Item的OnDblClick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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