Reputation: 79
i have following navigation,
<ul class="content-nav">
<li id="nav-liv" class="tab"><a href="index.php?p=recent" page="recent">Recent</a></li>
<li id="nav-liv"><a href="index.php?p=friends" page="friends">Friends</a></li>
<li id="nav-liv"><a href="index.php?p=following" page="following">Following</a></li>
<li id="nav-liv"><a href="index.php?p=my" page="my">My</a></li>
<li id="nav-liv"><a href="index.php?p=fav" page="fav">Favourite</a></li>
<ul>
with jquery code
$(".content-nav li#nav-liv a").click(function(){
$("li#nav-liv").removeClass("tab");
$(this).parent().addClass("tab");
return false;
});
this is very much working in every browser except ie 6. In ie 6 when i click on friend link it remove the tab class from recent link, but after clicking others links it doed not removeClass.
Upvotes: 0
Views: 1441
Reputation: 10981
ID's should be unique.
<ul class="content-nav">
<li class="nav-liv tab"><a href="index.php?p=recent" page="recent">Recent</a></li>
<li class="nav-liv"><a href="index.php?p=friends" page="friends">Friends</a></li>
<li class="nav-liv"><a href="index.php?p=following" page="following">Following</a></li>
<li class="nav-liv"><a href="index.php?p=my" page="my">My</a></li>
<li class="nav-liv"><a href="index.php?p=fav" page="fav">Favourite</a></li>
<ul>
$(".content-nav li.nav-liv a").click(function(){
$("li.nav-liv").removeClass("tab");
$(this).parent().addClass("tab");
return false;
});
Upvotes: 1
Reputation: 723598
Well, all your li
s have the ID #nav-liv
, I guess IE6 is choking on that. The first thing I would do is change them to classes and see if IE6 still has trouble.
Upvotes: 3