Reputation: 306
I want to attach a double click event on an ID/Element if there is a single left click on that same ID/Element.
for Ex my code is
if($("#file_upload").length > 0)
{
$("#file_upload").on('mousedown', function() {
$("#file_upload").dblclick(); //This thing not working in IE 10
});
}
this issue is while using jQuery.fileUpload.
jQuery version is 1.8.2
also i m binding event on mousedown
so it might get triggered on right click but i want event binding only on left click
Upvotes: 1
Views: 1985
Reputation: 1300
You're not telling the code what to do when the double click occurs.
Just as other events, the code should be told what to do when it occurs..
if($("#file_upload").length > 0)
{
$("#file_upload").on('mousedown', function() {
$("#file_upload").dblclick(function () {
alert("Double click!");
});
});
}
Next to this, i'm wondering it it'll work.. it's expecting to have a mouse down and seeing a double click occur.. when releasing the mouse button for a double click, i assume it'll leave the mousedown event, and the double click event won't be fired.
Might require some testing in this case.
Upvotes: 1