Live one!
jquery mouse clicks after changing color, click another button color restore
<script type=”text/javascript” src=”http://code.jquery.com/jquery-latest.js”></script>
<script type=”text/javascript”>
$(function(){
$(“#nav li”).click(function(){
$(“#nav li”).eq($(this).index()).addClass(“navdown”).siblings().removeClass(“navdown”);
})
})
</script>
<style>
a{text-decoration:none; color:#666666;}
#nav ul{ list-style:none; float:left; text-align:right; margin-top: 18px; line-height: 42px; margin-left: -2px;}
#Nav ul li {font-family: “Microsoft Yahei”, “Song style”; font-size: 14px; font-style: normal; font-weight: bold; letter-spacing: 4px;}
#nav ul li a:hover{ color:#666666;border:1px solid #F00;}
.navdown a{color:#ff0000; border:1px solid #F00;}
</style>
<body>
<div id=”nav”>
<ul>
<li class = “navdown”> <a href=”#”> <span> Homepage </span> </a> </li>
<li> <a href=”#”> <span> About us </span> </a> </li>
<li> <a href=”#”> <span> News </span> </a> </li>
<li> <a href=”#”> <span> Products </span> </a> </li>
<li> <a href=”#”> <span> Customer Case </span> </a> </li>
<li> <a href=”#”> <span> Contact us </span> </a> </li>
</ul>
</div>
</body>
Original link:http://www.qdonger.com/article-638-1.html