<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>e信wifi</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/nav.js"></script>
</head>
<body>
<div class="header_box">
<div class="header">
<div class="logo"><a href="index.html"><img src="images/logo.png"></a></div>
<div class="telephone"><img src="images/telephone.png"></div>
</div>
<!--<div class="nav_box">
<ul class="nav">
<li><a href="">首页</a></li>
<li><a href="">WiFi覆盖</a></li>
<li><a href="">成功案例</a></li>
<li><a href="">新闻资讯</a></li>
<li><a href="">联系我们</a></li>
</ul>
</div>-->
<div class="nav_box">
<div class="nav">
<a href="">首页</a>
<a href="">WiFi覆盖</a>
<a href="">成功案例</a>
<a href="">新闻资讯</a>
<a href="">联系我们</a>
</div>
</div>
</div>
<div class="banner_box"></div>
<div class="main_box"></div>
<div class="footer_box"></div>
</body>
<script>
$(document).ready(function(){
$(".nav a").first().addClass("current");
$(".nav a").click(function(){
$(this).addClass("current").siblings().removeClass("current");
})
})
</script>
</html>
你把浏览器报的错发出来看看才知道啊
a标签href为空,会刷新页面,current会失效