<div id="good" style="width:468px">广告代码1<br />广告代码2<br /></div>
<script type=text/javascript>marqueesHeight=60; //广告牌高度stopscroll=false;with(good){ style.width=0; style.height=marqueesHeight; style.overflowX="visible"; style.overflowY="hidden"; noWrap=true; onmouseover=new Function("stopscroll=true"); onmouseout=new Function("stopscroll=false"); } preTop=0; currentTop=marqueesHeight; stoptime=0; good.innerHTML+=good.innerHTML;
function init_srolltext(){ good.scrollTop=0; setInterval("scrollUp()",1);}init_srolltext();
function scrollUp(){ if(stopscroll==true) return; currentTop+=1; if(currentTop==marqueesHeight+1) { stoptime+=1; currentTop-=1; if(stoptime == 300) // 控制停留时间 100=1秒 { currentTop=0; stoptime=0; } } else { preTop=good.scrollTop; good.scrollTop+=1; if(preTop==good.scrollTop){ good.scrollTop=marqueesHeight; good.scrollTop+=1; } }
}init_srolltext();</script>
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18