欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

div+css不间断向上滚动模板

上一次给大家介绍一种div css的不间断滚动代码JS特别多(不间断滚动css代码),这次给大家介绍的是比较实用比较简单的不间断css滚动代码

 不间断div+css滚动演示图
DIV+CSS不间断滚动代码效果图 -CSS不间断滚动

 DIV+css代码:

 <p>&nbsp;</p>
<p><a href="http://www.divcss5.com/">div+css</a> <a href="http://www.divcss5.com/shouce/">css手册</a> <a href="http://www.divcss5.com/">css</a> <a href="http://www.divcss5.com/edu/">css研教室</a></p>
<p>&nbsp;</p>
<p>divcss5模板-上下不间断滚动<a href="http://www.divcss5.com/">DIV+CSS</a></p>
<p>
<div id="mq" onmouseover=iScrollAmount=0 style="OVERFLOW: hidden; WIDTH:330px; margin:0 auto; HEIGHT:22px; line-height:22px;" onmouseout=iScrollAmount=1>
<ul>
<li><a href="http://www.divcss5.com">div+css</a>向上不停滚动演示</li>
<li><a href="http://www.divcss5.com">CSS</a>向上不停滚动演示</li>
<li><a href="http://www.divcss5.com">divcss</a>向上不停滚动演示</li>
</ul>
</div>
<script src="muqruujs.js" type="text/javascript"></script></p>
<p ><a href="http://www.divcsss5.com/">DIV+CSS</a>提示您,可以直接查看本页<a href="http://www.divcss5.com/html/h26.html" title="查看源代码">源代码</a>将其保存下来</p>

 

不间断JS代码:

 var oMarquee = document.getElementById("mq"); //滚动对象
var iLineHeight = 22; //单行高度,像素
var iLineCount = 3; //实际行数
var iScrollAmount = 1; //每次滚动高度,像素
function run() { oMarquee.scrollTop += iScrollAmount; if ( oMarquee.scrollTop == iLineCount * iLineHeight ) oMarquee.scrollTop = 0; if ( oMarquee.scrollTop % iLineHeight == 0 ) { window.setTimeout( "run()", 2500 ); } else { window.setTimeout( "run()", 10 ); } } oMarquee.innerHTML += oMarquee.innerHTML; window.setTimeout( "run()", 2500 );

完整div+css不间断滚动代码
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="" name="keywords" />
<title>向上不停滚动代码-www.divcss5.com-演示</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/* CSS代码如下 www.divcss5.com */
</style>
</head>
<body>
<p>&nbsp;</p>
<p><a href="http://www.divcss5.com/">div+css</a> <a href="http://www.divcss5.com/shouce/">css手册</a> <a href="http://www.divcss5.com/">css</a> <a href="http://www.divcss5.com/edu/">css研教室</a></p>
<p>&nbsp;</p>
<p>divcss5模板-上下不间断滚动<a href="http://www.divcss5.com/">DIV+CSS</a></p>
<p>
<div id="mq" onmouseover=iScrollAmount=0 style="OVERFLOW: hidden; WIDTH:330px; margin:0 auto; HEIGHT:22px; line-height:22px;" onmouseout=iScrollAmount=1>
<ul>
<li><a href="http://www.divcss5.com">div+css</a>向上不停滚动演示</li>
<li><a href="http://www.divcss5.com">CSS</a>向上不停滚动演示</li>
<li><a href="http://www.divcss5.com">divcss</a>向上不停滚动演示</li>
</ul>
</div>
<script src="muqruujs.js" type="text/javascript"></script></p>
<p ><a href="http://www.divcsss5.com/">DIV+CSS</a>提示您,可以直接查看本页<a href="http://www.divcss5.com/html/h26.html" title="查看源代码">源代码</a>将其保存下来</p>
</body>
</html>

这里将JS放放入muqruujs.js的JS文件里,注意的是JS文件放置的位置及滚动代码JS里的取值

在线演示http://www.divcss5.com/yanshi/2013032601/

以上为DIV+CSS模板中的纯CSS不间断滚动CSS布局代码及说明。
查看CSS不间断滚动网页演示 -点我查看
点击另存为下载此DIV+CSS上下无间断滚动代码打包下载:http://www.divcss5.com/bbs/thread-479-1-1.html

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/template/m109.shtml