How to call a mouseover function on an element, if not actually

In jQuery, is it possible for an element to act as if it is automatically hovering when the page loads, if it is not really hovering? I mean, I won’t put a pointer on the element that I want it to do what it would do if I put it.

+5
source share
4 answers

Use .trigger () to fire the event.

$('#foo').trigger('mouseover');
+14
source

You can directly call the handler

$('abc').mouseover();
+8
source

document.ready , , , .

+2
source

Call event hint before document.ready

-1
source

All Articles