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
精彩评论