hi all im building a menu and im trying to put an hover effect on each menu item but... when i hover everything is working great and i get the html i want and the menu item has a backgruond image.
but the unhover effect dosnt fire most of the times. i found out that if i move my mouse horziantly across the ul menu it works fine. but if my mouse does a vertical move across the li item it dosnt fire. my code is this:
$("ul.menu li").hover(ChangeToHoverMenuItem, ChangeBackMenuItem);
function ChangeToHoverMenuItem()
{
var currLi = $(this);
lastLi = currLi;
var currMenuItemText = currLi.find("a").text();
currLi.html("");
currLi.append("<div style='float:right;'><div class='right_item_hov'></div>" +
"<a class='item_menu_hov'>" +
currMenuItemText +
"</a>" +
"<div class='left_item_hov'></div></div>");
}
function ChangeBackMenuItem ()
{
var currLi = $(this);
var currMenuItemText = currLi.find("a").text();
currLi.html("");
currLi.append("<a>" + currMenuItemText + "</a>");
}
<div class="menu_middle">
<ul class="menu">
<li>
<a>
main
</a>
</li>
<li>
<a>
gallery
</a>
</li>
<li>
<a>
event
</a>
</li>
<li>
<a>
about
</a>
</li>
<li>
<a>
contact
</a>
</li>
</ul>
</div>
thank you