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
Just an update on why. I use agent ransack and if I can launch it with a double-click I get two instances of the program. I can use different search parameters on each.
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();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container">click 1</div>
<div id="container2">click 2</div>
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
).