首页 > 其他 > 详细

简单的文字滚动效果

时间:2014-07-19 17:32:02      阅读:333      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
ul li
{

height: 30px;

}
</style>
</head>

<body>
<div id="demo" style="height: 50px; overflow:hidden;border: 1px solid #000;">
<div id="demo1">
<ul>
<li>di yitiao xinwen</li>
<li>di yitiao xinwen</li>

<li>di yitiao xinwen</li>
<li>GGGGGGGGGGGGG</li>
</ul>
</div>
<div id="demo2"></div>
</div>
<script>
var speed = 50
demo2.innerHTML = demo1.innerHTML
function Marquee() {
if (demo2.offsetTop - demo.scrollTop <= 0)
demo.scrollTop -= demo1.offsetHeight
else {
demo.scrollTop++
}
}
var MyMar = setInterval(Marquee, speed)
demo.onmouseover = function () { clearInterval(MyMar) }
demo.onmouseout = function () { MyMar = setInterval(Marquee, speed) }
</script>

</body>
</html>

简单的文字滚动效果,布布扣,bubuko.com

简单的文字滚动效果

原文:http://www.cnblogs.com/fengpiaoling/p/3853837.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!