日期:2014-05-16 浏览次数:20387 次
<script type="text/javascript">
// 导航菜单判断
var url = window.location.href;
var Temp = url.split("/");
var t = 0;
var File = "index,news,gallery,archives,books,about"; //对应文件
var Test = File.split(",");
var Nav = document.getElementById("nav").getElementsByTagName("li");
for(var i=0;i<Nav.length;i++){
if(Test[i]==Temp[3]){
t = i;
}
Nav[i].className = "";
}
Nav[t].className = "first";
</script>
<div id="nav">
<ul>
<li id="" class="first"><a href="/index.php">首页</a></li>
<li><a href="/news.php">2</a></li>
<li id=""><a href="/gallery.php">3</a></li>
<li><a href="/archives.php">4</a></li>
<li><a href="/books.php">5</a></li>
<li><a href="/about.php">6</a></li>
</ul>
</div>