Is it possible to trigger double click on user\'s single click? note that I want the same behaviour as it was double clicked by using mouse, Is it possible to get the same b
Not sure where exactly your problem is, but this code works exactly as expected:
$("#container").dblclick(function() {
//code executed on jQuery double click rather than mouse double click
alert('dblclick');
});
$("#container").click(function() {
alert('click');
$(this).dblclick();
});
$("#container2").click(function() {
$("#container").click();
});
click 1
click 2
If you click on 'click 1' - you will have the 2 alerts (the original and the dblclick).
If you click on 'click 2' - the jquery will trigger the click
on the first element, which will trigger 2 alerts (the click
and the dblclick
).