I am 100% sure I got lost with the jQuery selectors. My hover effect is out of order.
Here is my structure:
<div class="main">
<div class="header">
<div class="header_resize">
<div class="menu_nav">
<ul>
<li class="active">
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Default.aspx">Start Page</asp:HyperLink>
<em>Animate this text</em>
</li>
<li>
</ul>
</div>
</div>
</div>
</div>
and here is the jQuery that should do the animation:
$(".menu_nav ul li a").hover(function () {
$(this).next("em").animate({ opacity: "show", top: "-75" }, "slow");
}, function () {
$(this).next("em").animate({ opacity: "hide", top: "-85" }, "fast");
});
and this one is the css:
.menu_nav ul li em {
background: url(images/hover.png) no-repeat;
width: 180px;
height: 45px;
position: absolute;
top: -85px;
left: -15px;
text-align: center;
padding: 20px 12px 10px;
font-style: normal;
z-index: 2;
display: none;
}
What am I doing wrong here?
I simplified your css but basically you need to change the
opacityto1notshowLink to fiddle
Note the css change from
display: none=>opacity: 0