try this one<META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
<!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=gb2312" />
<title> </title>
<style type="text/css">
*{margin:0;padding:0;}
body{font:12px/20px "宋体";color:#fff;} a{color:#0000;text-decoration:none;line-hehight:20px;} a:hover,a:active{color:#0000;line-hehight:20px;text-decoration:underline;} #scrollnews{height:20px;overflow:hidden;border:1px solid #f60;}
#scrollnews2{height:40px;overflow:hidden;border:1px solid #f60;}
ul,li{list-style:none;} </style>
</head>
<body style="background:transparent;">
<div id="scrollnews">
<a href="#" target="_blank">111111111111111111111111111 </a> <br />
<a href="#" target="_blank">222222222222222222222222222 </a> <br />
<a href="#" target="_blank">333333333333333333333333333 </a> <br /> </div>
<div id="scrollnews2">
<a href="#" target="_blank">111111111111111111111111111 </a> <br />
<a href="#" target="_blank">222222222222222222222222222 </a> <br />
<a href="#" target="_blank">333333333333333333333333333 </a> <br /> </div>
<script type="text/javascript">
$ = function(id){return document.getElementById(id);}
Function.prototype.THIS = function(this2){var self=this;return function(){self.apply(this2,arguments);}};var scrollObj = function(){
this.init=function(elem){
this.obj = $(elem.id);
this.scrollHeight = elem.ScrollHeight;
this.scrollNum = elem.ScrollNum;
this.stopTime = elem.StopTime;
this.scrollTime = elem.ScrollTime;
this.cHeight = this.obj.scrollHeight;
this.obj.innerHTML += this.obj.innerHTML;
this.timer1 = setTimeout(this.scroll.THIS(this),1000);
this.h = 0;
};
this.scroll = function(){
this.obj.scrollTop += this.scrollNum;
this.h += this.scrollNum;
if(this.h==this.scrollHeight){
this.h=0;
clearTimeout(this.timer1);
if(this.obj.scrollTop >= this.cHeight) this.obj.scrollTop = this.obj.scrollTop - this.cHeight;
this.timer1 = setTimeout(this.scroll.THIS(this),this.stopTime);
}else{
this.timer1 = setTimeout(this.scroll.THIS(this),this.scrollTime);
}
};
};
(new scrollObj).init({id:"scrollnews",ScrollHeight:20,ScrollNum:1,StopTime:1000,ScrollTime:10});
(new scrollObj).init({id:"scrollnews2",ScrollHeight:40,ScrollNum:1,StopTime:50,ScrollTime:50});
</script>
</body>
</html>
<!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=gb2312" />
<title> </title>
<style type="text/css">
*{margin:0;padding:0;}
body{font:12px/20px "宋体";color:#fff;} a{color:#0000;text-decoration:none;line-hehight:20px;} a:hover,a:active{color:#0000;line-hehight:20px;text-decoration:underline;} #scrollnews{height:20px;overflow:hidden;border:1px solid #f60;}
#scrollnews2{height:40px;overflow:hidden;border:1px solid #f60;}
ul,li{list-style:none;} </style>
</head>
<body style="background:transparent;">
<div id="scrollnews">
<a href="#" target="_blank">111111111111111111111111111 </a> <br />
<a href="#" target="_blank">222222222222222222222222222 </a> <br />
<a href="#" target="_blank">333333333333333333333333333 </a> <br /> </div>
<div id="scrollnews2">
<a href="#" target="_blank">111111111111111111111111111 </a> <br />
<a href="#" target="_blank">222222222222222222222222222 </a> <br />
<a href="#" target="_blank">333333333333333333333333333 </a> <br /> </div>
<script type="text/javascript">
$ = function(id){return document.getElementById(id);}
Function.prototype.THIS = function(this2){var self=this;return function(){self.apply(this2,arguments);}};var scrollObj = function(){
this.init=function(elem){
this.obj = $(elem.id);
this.scrollHeight = elem.ScrollHeight;
this.scrollNum = elem.ScrollNum;
this.stopTime = elem.StopTime;
this.scrollTime = elem.ScrollTime;
this.cHeight = this.obj.scrollHeight;
this.obj.innerHTML += this.obj.innerHTML;
this.timer1 = setTimeout(this.scroll.THIS(this),1000);
this.h = 0;
};
this.scroll = function(){
this.obj.scrollTop += this.scrollNum;
this.h += this.scrollNum;
if(this.h==this.scrollHeight){
this.h=0;
clearTimeout(this.timer1);
if(this.obj.scrollTop >= this.cHeight) this.obj.scrollTop = this.obj.scrollTop - this.cHeight;
this.timer1 = setTimeout(this.scroll.THIS(this),this.stopTime);
}else{
this.timer1 = setTimeout(this.scroll.THIS(this),this.scrollTime);
}
};
};
(new scrollObj).init({id:"scrollnews",ScrollHeight:20,ScrollNum:1,StopTime:1000,ScrollTime:10});
(new scrollObj).init({id:"scrollnews2",ScrollHeight:40,ScrollNum:1,StopTime:50,ScrollTime:50});
</script>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货