开发者

Remove OnDblClick Event on Item using jQuery

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();");
})();

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 it开发者_C百科em, 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.


Just .unbind() it:

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


Its been a while since this thread has been opened but thought I would post my solution.

jQuery(function(j$){//This will execute on page load

  $('selector').prop('ondblclick', "");
});

This sets the ondblcli

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜