<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<div id="marquees">
<a href="#"><img src="images/index_52.jpg" width="117" height="42" alt="1"/></a>
<a href="#"><img src="images/index_54.jpg" width="117" height="42" alt="2"/></a>
<a href="#"><img src="images/index_56.jpg" width="117" height="42" alt="3"/></a>
<a href="#"><img src="images/index_58.jpg" width="123" height="42" alt="4"/></a>
</div>
<script language="JavaScript">
marqueesWidth=200;
stopscroll=false;
with(marquees){
style.width=marqueesWidth;
style.height=0;
style.overflowX="hidden";
style.overflowY="visible";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preTop=0; currentTop=0;
function init(){
templayer.innerHTML="";
while(templayer.offsetWidth<marqueesWidth){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollLeft()",50);
}
document.body.onload=init;
function scrollLeft(){
if(stopscroll==true) return;
preTop=marquees.scrollLeft;
marquees.scrollLeft+=1;
if(preTop==marquees.scrollLeft){
marquees.scrollLeft=templayer.offsetWidth-marqueesWidth;
marquees.scrollLeft+=1;
}
}
</script>
</HEAD>
<BODY>
</BODY>
</HTML>
打扰一下`~~我可以问下
几这个代码的意思吗?
1。style.width是什么对象的宽度
2。hidden,visible是属性吗?什么意思呢~
3。('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>')
这句话是什么意思呢?(是不是设定另个容器,赋予属性?)
4。templayer.innerHTML(innerHTML这个属性什么意思呢?)
5。templayer.offsetWidth(offsetWidth是什么意思呢)
先说声:谢谢~