js文字滚动停顿效果代码
js文字滚动停顿效果代码
发布时间:2016-12-30 来源:查字典编辑
摘要:间断滚动_www.jb51.net_查字典教程网#Marquee{height:60px;overflow:hidden;}#Marquee...

<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>

<title>间断滚动_www.jb51.net_查字典教程网</title>

<style>

#Marquee{height:60px;overflow:hidden;}

#Marqueediv{border:1pxsolid#DDD3FE;background:#EEECF4;height:58px;}

</style>

</head>

<body>

<divid="Marquee">

<divstyle="width:160px;height:58px">间断-1-caiying2007</div>

<divstyle="width:160px;height:58px">间断-2-caiying2007</div>

<divstyle="width:160px;height:58px">间断-3-caiying2007</div>

</div>

<script>

varMar=document.getElementById("Marquee");

varchild_div=Mar.getElementsByTagName("div")

varpicH=60;//移动高度

varscrollstep=3;//移动步幅,越大越快

varscrolltime=20;//移动频度(毫秒)越大越慢

varstoptime=3000;//间断时间(毫秒)

vartmpH=0;

Mar.innerHTML+=Mar.innerHTML;

functionstart(){

if(tmpH<picH){

tmpH+=scrollstep;

if(tmpH>picH)tmpH=picH;

Mar.scrollTop=tmpH;

setTimeout(start,scrolltime);

}else{

tmpH=0;

Mar.appendChild(child_div[0]);

Mar.scrollTop=0;

setTimeout(start,stoptime);

}

}

onload=function(){setTimeout(start,stoptime)};

</script></body>

</html>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类