JQuery trigger mouseout event

Is it possible to trigger the mouseout event on a link element using jQuery?

those. Something like that

$(linkEle).mouseout() 

I want this to work on an iPad, which, although it has no mouse cursor, does have an event ...

+6
source share
7 answers

Yes, jquery has a mouseout event handler - http://api.jquery.com/mouseout/

 $('some_selector_here').mouseout(function() { // Do some stuff } $('some_selector_here').trigger('mouseout'); 
+11
source

You might be able to use:

 .trigger('mouseleave'); 

In the shape of:

 $('#elementToTriggerMouseLeaveOn').trigger('mouseleave'); 

Literature:

0
source

I do not know about ipad, but it works as you posted. http://jsfiddle.net/tESUc/

0
source
 $(linkEle).mouseout(); 

or

 $(linkEle).trigger('mouseout'); 

or

 $(linkEle).trigger($.Event('mouseout')); 
0
source

Try with tap event

click - fires after clicking the pnscreen element.

http://www.roccles.com/?p=134

 $('.link').live('tap',function(event) { //TODO }); 

Mouseover state does not exist on touch screens

0
source

Mouse / exit events do not work on demand on the ipad. Take a look at touchstart / touchmove and tap on events that are specifically designed for touch devices.

0
source

Something like this http://jsfiddle.net/hTYKQ/ Will work on ipad, but this way:

  • The 1st click on an element launches the mouseenter function.


  • 2nd click starts the material .. if it has material ... as a link ( http://jsfiddle.net/qxM33/1/ I screwed <a> href , but you get the point.)


  • Click outside the element, launches the mouseleave function.

This article talks about how the jquery mouse over and mouse out functions work just like the ipad click functions.

0
source

Source: https://habr.com/ru/post/893706/


All Articles