var h = this.getElementsByTagName("div")[0].offsetTop + y;
这样对吗?
这样对吗?
2016-01-27
font-size: 11pt;
list-style-type: none;
text-align: left;
padding-left: 8px;
z-index: 3;
background-image: url(1.png);
background-repeat: no-repeat;
background-position: right;
}
list-style-type: none;
text-align: left;
padding-left: 8px;
z-index: 3;
background-image: url(1.png);
background-repeat: no-repeat;
background-position: right;
}
2016-01-25
window.onload = function () {
var ali = document.getElementsByTagName('li');
for(var i=0;i<ali.length;i++)
{ali[i].i=i;
ali[i].onmouseover = function(){
this.className = "lihover";
}
ali[i].onmouseout = function(){
this.className = "";
}
}
var ali = document.getElementsByTagName('li');
for(var i=0;i<ali.length;i++)
{ali[i].i=i;
ali[i].onmouseover = function(){
this.className = "lihover";
}
ali[i].onmouseout = function(){
this.className = "";
}
}
.topmenu li{
background-image:url('http://img1.sycdn.imooc.com//5411027300014f0200220030.jpg');
background-repeat:no-repeat;
background-position:right;
background-color:rgba(0,0,0,0.03);
}
.topmenu li:hover{
background-color:rgba(0,0,0,0.0);
background-image:none;
}
background-image:url('http://img1.sycdn.imooc.com//5411027300014f0200220030.jpg');
background-repeat:no-repeat;
background-position:right;
background-color:rgba(0,0,0,0.03);
}
.topmenu li:hover{
background-color:rgba(0,0,0,0.0);
background-image:none;
}