When I hold the mouse button I need to call the mouse up event manually(without involving any mouse click). How to do that?
Asked
Active
Viewed 728 times
1
-
1`$el.mouseup()` – Rory McCrossan Oct 03 '16 at 11:51
-
2Although you can do that, it is rarely a good practice. Consider wrapping the whole event handler in a function and calling the function instead, while the mouse even will just call the wrapper. – Hristo Vrigazov Oct 03 '16 at 11:56
-
Yes `$( "#id" ).mouseup();` is working. – isuru Oct 06 '16 at 05:33
1 Answers
-1
Try this
$('yourElementSelector').trigger('mouseUp');

Aleksandar Matic
- 789
- 1
- 9
- 21
-
-
yes I did, on an older jQuery though... and it worked like a charm, it triggered the function I have bound to the mouseUp event – Aleksandar Matic Oct 03 '16 at 12:00