This is probably a beginners problem but I can’t get my links to work after adding jquery code to animate my anchors’ background.
This is the markup:
<ul class="nav">
<li> <span id="background"> </span><span id="active"></span><a href="page1.html" class="active">page 1</a> </li>
<li> <a href="page2.html">page 2</a> </li>
</ul>
This is the jquery code:
$("ul.nav a").click(function () {
$("span#background").fadeIn(800, function () {});
$("#active").animate({left: "+=2410"}, 950)
return false;
});
The “span” elements have background images via css and are dynamically placed within the active <li> element.
Thus the active link gets a background and an animated image flying in.
Now, when trying to click the link to page 2, the right target url appears in the browser, but the link doesn’t work. Probably the normal anchor action is being interfered by the jquery code. Is there something i overlooked?
this is the bare bones testpage
thanks anyone who has a clue!
The
return falsekills the click and prevents it from firing.