码迷,mamicode.com
首页 > Web开发 > 详细

Scroll文字滚动js

时间:2015-04-08 19:24:09      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:

function ScrollImgLeft(){
var speed=50,
	doc=document,
	scroll_begin = doc.getElementById("scroll_begin"),
	scroll_end = doc.getElementById("scroll_end"),
	scroll_div = doc.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML;
  function Marquee(){
	if(scroll_end.offsetTop-scroll_div.scrollTop<=0)
	  scroll_div.scrollTop-=scroll_begin.offsetHeight
	else
	  scroll_div.scrollTop++
  }
var MyMar=setInterval(Marquee,speed)
  scroll_div.onmouseover=function() {clearInterval(MyMar)}
  scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}
ScrollImgLeft();

  

Scroll文字滚动js

标签:

原文地址:http://www.cnblogs.com/xupeiyu/p/4403090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!