Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery trigger mouseout event

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

I.e. Something of the sort

$(linkEle).mouseout()

I want this to work on an iPad, which even though does not have any mouse cursor, does actually have the event...

like image 733
copenndthagen Avatar asked Jul 27 '11 17:07

copenndthagen


People also ask

What is Mouseout event in jQuery?

The mouseout event is sent to an element when the mouse pointer leaves the element. Any HTML element can receive this event.

What is the difference between Mouseout and Mouseleave?

This means that mouseleave is fired when the pointer has exited the element and all of its descendants, whereas mouseout is fired when the pointer leaves the element or leaves one of the element's descendants (even if the pointer is still within the element).

How do you check if the mouse is over an element?

You can simply use the CSS :hover pseudo-class selector in combination with the jQuery mousemove() to check whether the mouse is over an element or not in jQuery.

What is Mouseout Javascript?

The mouseup event is fired at an Element when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is located inside it. mouseup events are the counterpoint to mousedown events.


1 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');
like image 187
barfoon Avatar answered Sep 22 '22 14:09

barfoon