
html问题 求解各代码含义
<scripttype="text/javascript">window.onload=init;functioninit(){varnewLi=document.get...
<script type="text/javascript">
window.onload=init;
function init(){
var newLi=document.getElementsByName("level1");
for(var i=0;i<newLi.length;i++){
newLi[i].onmouseover=function(){
this.style.backgroundColor="green";
}
newLi[i].onmouseout=function(){
this.style.backgroundColor="";
}
}
newLiInner=document.getElementsByName("level2");
for(var i=0;i<newLiInner.length;i++){
newLi[i].onmouseover=function(){
this.style.backgroundColor="green";
}
newLi[i].onmouseout=function(){
this.style.backgroundColor="";
}
}
var product=document.getElementById("productInfoLi");
var productInFo=document.getElementById("productInfo");
var setIntervalMoveUl;
var moveNum;
product.onmouseover=function(){
productInfo.style.display="inline";
this.style.backgroundColor="green";
}
product.onmouseout=function(){
document.getElementById("productInfo").style.display="none";
this,style.backgroundColor="";
}}
</script> 展开
window.onload=init;
function init(){
var newLi=document.getElementsByName("level1");
for(var i=0;i<newLi.length;i++){
newLi[i].onmouseover=function(){
this.style.backgroundColor="green";
}
newLi[i].onmouseout=function(){
this.style.backgroundColor="";
}
}
newLiInner=document.getElementsByName("level2");
for(var i=0;i<newLiInner.length;i++){
newLi[i].onmouseover=function(){
this.style.backgroundColor="green";
}
newLi[i].onmouseout=function(){
this.style.backgroundColor="";
}
}
var product=document.getElementById("productInfoLi");
var productInFo=document.getElementById("productInfo");
var setIntervalMoveUl;
var moveNum;
product.onmouseover=function(){
productInfo.style.display="inline";
this.style.backgroundColor="green";
}
product.onmouseout=function(){
document.getElementById("productInfo").style.display="none";
this,style.backgroundColor="";
}}
</script> 展开
3个回答
展开全部
等window代码载入完毕后会执行init函数,基本就是个鼠标经过的简单效果。html应该很简单
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询