Mouseover and Mouseout Function jQuery

I have this script:

$("#teaser ul.buttons li").mouseover(function() { $("a",this).animate({ left: '0' },350); }).mouseout(function() { $("a",this).animate({ left: '-11px' },350); }); 

But when I now hang over element a. The mouse and mouse continue. How can I change this script. This is when I find element a. This is the start of the mouse when I find the item.

+6
jquery mouseover mouseout
source share
3 answers

Is there http://jsfiddle.net/BBUJ7/ what are you looking for? I changed mouseover and mouseout to hover since you mentioned the freeze in the question and added the CSS rule a {position:relative} .

+6
source share

use mouseenter and mouseleave instead of mouseover and mouseout

+10
source share

Here you have the html code:

 <ul class="buttons"> <li> <h2> <a class="koeriersdiensten" href="pagina.html" title="Koeriersdiensten">Koeriersdiensten <span>Lorem ipsum dolor sit amet</span> </a> </h2> </li> <li> <h2> <a class="taxivervoer" href="pagina.html" title="Taxivervoer">Taxivervoer <span>Lorem ipsum dolor sit amet</span> </a> </h2> </li> </ul> 
+1
source share

All Articles