下划线是<a>标签里的,清除的样式是:a{text-decoration:none;}
原点是<ul>标签里的,清除的样式是:ul{list-style:none;}
*{margin:0;padding:0}是设置所有元素的内外边距为0
原点是<ul>标签里的,清除的样式是:ul{list-style:none;}
*{margin:0;padding:0}是设置所有元素的内外边距为0
2016-04-09
不用js吧,在这讲还是挺有难度,直接修改触碰a标签时宽度增加20px以上效果一样的,简单好用.on,a:hover{background-color:#f60;color:#fff;margin-top:10px;width:120px}margin-top不一定用负值啊,根据自己设置ul、a的高度定的,我在a的css中设置的margin-top值+a的行高=ul行高就行了,然后触碰用正值就行了。同样添加触碰后增加a的宽度属性就行了。
2016-04-09
最新回答 / STRONG很壮不怕撞
你是说把move()方法的定义写在外面吗?那样应该是不可以的,因为你的 “ul”,是在鼠标划过的事件方法最上面定义的,把move()方法放在外面肯定找不到了。
2016-04-08
for(var i=0; i<aA.length; i++){
aA[i].onmouseover=function(){
var This=this;
clearInterval(This.time);
This.time=setInterval(function(){
This.style.width=This.offsetWidth+8+"px";
if(This.offsetWidth>=160)
clearInterval(This.time);
},30)
}
aA[i].onmouseover=function(){
var This=this;
clearInterval(This.time);
This.time=setInterval(function(){
This.style.width=This.offsetWidth+8+"px";
if(This.offsetWidth>=160)
clearInterval(This.time);
},30)
}