<script defer>
function create(iId,iTop,iLeft,iWidth,iHeight,n) {
var item=["浙江","宁波","余姚","梁弄","上贤","汪巷"]
var menu0=document.createElement("div");
menu0.id=iId;
menu0.style.position="absolute";
menu0.style.top=iTop;
menu0.style.left=iLeft;
menu0.style.width=iWidth;
menu0.style.height=iHeight;
menu0.style.border="1px solid red";
menu0.style.backgroundColor="yellow";
menu0.innerHTML="Menu";
menu0.onmouseover=fnMouseIn;
document.body.appendChild(menu0);
for(var i=1;i<=n;i++) {
if(i%2!=0) {
var temp="";
temp+="menu"+i+"=document.createElement('div');";
temp+="menu"+i+".id='"+iId+i+"';";
temp+="menu"+i+".style.position='absolute';";
temp+="menu"+i+".style.top=parseInt(menu"+(i-1)+".style.top)+parseInt(menu0.style.height);";
temp+="menu"+i+".style.left="+(iLeft-100)+";";
temp+="menu"+i+".style.width="+iWidth+";";
temp+="menu"+i+".style.height="+iHeight+";";
temp+="menu"+i+".style.border='1px solid red';";
temp+="menu"+i+".style.backgroundColor='skyblue';";
temp+="menu"+i+".style.filter='alpha(opacity=0)';";
temp+="menu"+i+".innerHTML=item["+(i-1)+"];";
eval(temp);
}
else {
temp="";
temp+="menu"+i+"=document.createElement('div');";
temp+="menu"+i+".id='"+iId+i+"';";
temp+="menu"+i+".style.position='absolute';";
temp+="menu"+i+".style.top=parseInt(menu"+(i-1)+".style.top)+parseInt(menu0.style.height);";
temp+="menu"+i+".style.left="+(iLeft+100)+";";
temp+="menu"+i+".style.width="+iWidth+";";
temp+="menu"+i+".style.height="+iHeight+";";
temp+="menu"+i+".style.border='1px solid red';";
temp+="menu"+i+".style.backgroundColor='skyblue';";
temp+="menu"+i+".style.filter='alpha(opacity=0)';";
temp+="menu"+i+".innerHTML=item["+(i-1)+"];";
eval(temp);
}
eval("document.body.appendChild(menu"+i+")");
}
}
var iLeftLine=50;
function fnMouseIn() {
if(iLeftLine<150) {
for(var i=1;i<=6;i++) {
if(i%2!=0) {
var sHtml="";
sHtml+="menu"+i+".style.pixelLeft+=10;";
sHtml+="menu"+i+".filters.alpha.opacity+=10;";
eval(sHtml);
}
else {
sHtml="";
sHtml+="menu"+i+".style.pixelLeft-=10;";
sHtml+="menu"+i+".filters.alpha.opacity+=10;";
eval(sHtml);
}
}
iLeftLine+=10;
}
else {
clearTimeout(iTimerID);
return;
}
iTimerID=setTimeout("fnMouseIn()",3);
}
create("create",20,150,57,22,6);
</script>
回复 更多评论