为什么不能伸缩
<style>
*{margin: 0; padding: 0;}
ul{list-style: none;border-bottom:5px solid #F60;height:50px;padding-left:30px}
li{float: left;margin-top:20px }
a{text-decoration:none;display: block; height: 30px;line-height: 30px; width:120px; background-color: #ccc; margin-bottom: 1px; text-align: center; }
.on,a:hover{color:#fff;background-color: #F60;height:30px;line-height:30px}
</style>
<script>
window.onload=function(){
var aA = document.getElementsByTagName('a');
for(var i =0;i<aA.length;i++){
aA[i].onmuseover=function(){
var This = this;
This.time=setInterval(function(){
This.style.width=This.offsetWidth+8+"px";
if(This.offsetWidth>=160){
clearInterval(This.time)
}
},30)
}
}
}
</script>
</head>
<body>
<ul>
<li><a class="on" href="#">首 页</a></li>
<li><a href="#">新闻资讯</a></li>
<li><a href="#">产品展示</a></li>
<li><a href="#">售后服务</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</body>
</html>