开启企业建站营销新时代、免费建站平台倡导者  站长学院  高端定制请点这里
热线:13913253836
您现在的位置:首页 > 站长学院 > 建站资讯 > 建站、设计教程 > 滚动

javascript文字无间断滚动效果

作者:eycms 日期:2016/2/16 17:45:46 人气:33

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w.org/1999/xhtml">


<head>

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

<title>javascript文字无间断滚动效果(文字上下无缝滚动)</title>

<meta name="description" content="javascript无间断滚动效果(上下无缝滚动)" />

<meta name="keywords" content="javascript无间断滚动效果(上下无缝滚动)" />

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />


</head>


<body>


<div id="newlist" onmouseover="clearInterval(timerluwei_1)" onmouseout="timerluwei_1=setInterval(marluwei_1,50)" style="float:left;width:200px;height:100px;border:1px #cccccc solid;overflow:hidden;">

<div id="newlist1">

<a href="http://www./" style="display:block;">网页特效代码</a>

<a href="http:///" style="display:block;">地坪</a>

</div>

<div id="newlist2">

</div>

</div>

<div id="hotlist" onmouseover="clearInterval(timerluwei_2)" onmouseout="timerluwei_2=setInterval(marluwei_2,50)" style="float:left;margin-left:30px;width:200px;height:100px;border:1px #cccccc solid;overflow:hidden;">

<div id="hotlist1">

<a href="/" style="display:block;">网页特效代码</a>

<a href="" style="display:block;">地坪</a>

</div>

<div id="hotlist2">

</div>

</div>

<script language="javascript">

//第1个滚动框

var tluwei_1=getid("newlist"),t1luwei_1=getid("newlist1"),t2luwei_1=getid("newlist2"),shluwei_1=getid("show"),timer;

t2luwei_1.innerHTML=t1luwei_1.innerHTML;

function marluwei_1(){

if(t2luwei_1.offsetTop<=tluwei_1.scrollTop)

tluwei_1.scrollTop-=t1luwei_1.offsetHeight;

else

tluwei_1.scrollTop++;

}

timerluwei_1=setInterval(marluwei_1,50);

//第2个滚动框

var tluwei_2=getid("hotlist"),t1luwei_2=getid("hotlist1"),t2luwei_2=getid("hotlist2"),shluwei_2=getid("show"),timer;

t2luwei_2.innerHTML=t1luwei_2.innerHTML;

function marluwei_2(){

if(t2luwei_2.offsetTop<=tluwei_2.scrollTop)

tluwei_2.scrollTop-=t1luwei_2.offsetHeight;

else

tluwei_2.scrollTop++;

}

timerluwei_2=setInterval(marluwei_2,50);



function getid(id){

return document.getElementById(id);

}

</script>


</body>


</html></td>

 </tr>

</table>


回到顶部