How can I trigger mouseover event using jQuery just for a specific element, without allowing the event to propagate to the parent controls.
I know how to trigger the event: $('selector').trigger('mouseover');
For example I have an image
inside tr
. I have hover event handlers for both of them.
I want to manually trigger hover-in event just for the image.
Does anyone have an idea?
I found the answer looking in the examples here. Here is the code solving my problem:
var event = jQuery.Event('<event_name>');
event.stopPropagation();
$('<selector>').trigger(event);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With