※ 新跑馬燈 ※
|
<script language="JavaScript1.2"> <!-- var marqueewidth=470; // 跑馬燈的寬度(IE 中可用百分比,注意要加引號) var marqueeheight=40; // 跑馬燈的高度 var speed=6; // 捲動速度(越大越快) var marqueecontents='<IMG src="r1.gif" height=31 width=36 border=0> 新跑馬燈展示區,這是一個新型的跑馬燈!'; // 跑馬燈顯示的字串 if (document.all) document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>'); function regenerate() {window.location.reload();} function regenerate2(){ if (document.layers){ setTimeout("window.onresize=regenerate",450); intializemarquee(); } } function intializemarquee(){ document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>'); document.cmarquee01.document.cmarquee02.document.close(); thelength=document.cmarquee01.document.cmarquee02.document.width; scrollit(); } function scrollit(){ if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){ document.cmarquee01.document.cmarquee02.left-=speed; setTimeout("scrollit()",100); } else { document.cmarquee01.document.cmarquee02.left=marqueewidth; scrollit(); } } window.onload=regenerate2; //--> </script> <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01"> <layer name="cmarquee02"></layer> </ilayer> |