域名频道-专业提供域名注册,网站空间,电子邮箱,VPS主机等服务
首页 域名注册 虚拟主机 香港主机 美国主机 VPS主机 网站建设 ShopEX网店 软件开发 客户中心 购物车
域名服务,域名注册 常见问题
文章搜索


本类TOP10
·松江网页设计_松江网页制...
·上海轨道交通图-上海地图
·松江公交线路图-松江地图
·marquee连续滚动
·今天几度?-天气预报-全...
·松江新城地图-松江地图
·松江城区地图-松江地图
·HAO123邮箱登陆代码
·shopex免费模板,下...
·松江DNS服务器地址,松...
当前位置:域名频道首页 > 常见问题 > 网页制作
js文字上下滚动

js文字上下滚动

<div>
<table width="320" cellpadding="0" cellspacing="0" align="left" style="border-collapse:collapse;border:1px solid black;">
<tr>
<td valign="top">
<div class="Contentnr auto">
<style>
#msg_weibo {width:300px;height:186px;*height:186px;_height:170px;margin:10px auto 0;zoom:1; overflow:hidden;font-size:12px;line-height:20px;margin-bottom:4px;background:#ffffff;}
#msg_weibo a{margin-right:6px;color:#003C71;text-decoration:none;}
#msg_weibo a:hover{color:#c00;text-decoration:underline;}
#msg_weibo img{margin-top:2px;}
#msg_weibo span{color: #888;}
#msg_weibo div{padding:8px 0 11px 0 ;overflow:hidden;zoom:1;background:url(/upload/201009/20100901004427526.gif) left bottom repeat-x}
#msg_weibo span a{display:block;}
#msg_weibo img{float:left;width:50px; height:50px; padding:2px; border:#D6D6D6 1px solid;}
#msg_weibo p{float:left;width:295px; padding-left:5px; }
</style>
<div id="msg_weibo">
<div class="con"><p>
www.111cn.net
</p></div>
<div class="con"><p>
js文字向上滚动js文字向上滚动js文字向上滚动js文字向上滚动
</p></div>
<div class="con"><p>
男篮,加油
</p></div>
<div class="con"><p>昨天竞彩网让分胜负是希腊让中国20分!…中国打得不错!死了一大片彩民
</p></div>
<div class="con"><p>
有希望
</p></div>
<div class="con"><p>
晚上的比赛将是男篮在这届世锦赛的首胜。加油
</p></div>
<div class="con"><p>
今晚的中国男篮让我刮目相看了,也完全出乎我的意料!积极主动、神勇自信、信赖队友、坚持自己的打法、不慌张,这简直是一支梦幻的国家队,如果个人技术能再好一点,还真有世界强队的样子。能跟前欧洲冠军希腊队打成这样,真的很佩服,不得不竖大拇哥。易建联、王治郅,个个好样的!</p>
</div>
<div class="con"><p>
<a target="_blank">刘伟其实这场还行,只是手感不好,如果那两个投篮进了肯定又有特多人说他是好控位了,而且还会说是救了中国,所以不要总怪刘伟,还是因为中国整体实力和希腊比不了,不过这场打的挺好了,这么打下去我相信中国会出线的
</p></div>
<div class="con"><p>
鄙视那些自以为了不起的人,同样是中国人,你那么凶不去世锦赛上牛比?
</p></div>
</div>

</div>
</td>
</tr>
</table>

<script language="javascript">
var $ = function (d){
typeof d == "string" &&(d = document.getElementById(d));
return $.fn.call(d);
};
$.fn = function (){
this.addEvent = function (sEventType,fnHandler){
if (this.addEventListener) {this.addEventListener(sEventType, fnHandler, false);}
else if (this.attachEvent) {this.attachEvent("on" + sEventType, fnHandler);}
else {this["on" + sEventType] = fnHandler;}
}
this.removeEvent = function (sEventType,fnHandler){
if (this.removeEventListener) {this.removeEventListener(sEventType, fnHandler, false);}
else if (this.detachEvent) {this.detachEvent("on" + sEventType, fnHandler);}
else { this["on" + sEventType] = null;}
}
return this;
};
var Class = {create: function() {return function() { this.initialize.apply(this, arguments); }}};
var Bind = function (obj,fun,arr){return function() {return fun.apply(obj,arr);}}
var Marquee = Class.create();
Marquee.prototype = {
initialize: function(id,name,out,speed) {
this.name = name;
this.box = $(id);
this.out = 3;//滚动间隔时间,单位秒
this.speed = speed;
this.d = 1;
this.box.style.position = "relative";
this.box.scrollTop = 0;
var _li = this.box.firstChild;
while(typeof(_li.tagName)=="undefined")_li = _li.nextSibling;
this.lis = this.box.getElementsByTagName(_li.tagName);
this.len = this.lis.length;
for(var i=0;i<this.lis.length;i++){
var __li = document.createElement(_li.tagName);
__li.innerHTML = this.lis[i].innerHTML;
this.box.appendChild(__li);//cloneNode
if(this.lis[i].offsetTop>=this.box.offsetHeight)break;
}
this.Start();
this.box.addEvent("mouseover",Bind(this,function(){clearTimeout(this.timeout);},[]));
this.box.addEvent("mouseout",Bind(this,this.Start,[]));
},
Start:function (){
clearTimeout(this.timeout);
this.timeout = setTimeout(this.name+".Up()",this.out*1000)
},
Up:function(){
clearInterval(this.interval);
this.interval = setInterval(this.name+".Fun()",10);
},
Fun:function (){
this.box.scrollTop+=this.speed;
if(this.lis[this.d].offsetTop <= this.box.scrollTop){
clearInterval(this.interval);
this.box.scrollTop = this.lis[this.d].offsetTop;
this.Start();
this.d++;
}
if(this.d >= this.len + 1){
this.d = 1;
this.box.scrollTop = 0;
}
}
};
$(window).addEvent("load",function (){
marquee = new Marquee("msg_weibo","marquee",1,2);
});
</script>
</div>

 

来自:域名频道 时间:2010-9-2 返回 常见问题 首页
关于我们 联系方式 付款事宜 招聘启事 网站地图 域名注册 虚拟主机 法律顾问

Copyright 2000-2013 域名频道(www.DNS110.com)
地址:上海市松江区新松江路1188弄37号 邮编:201620
电话:021-67820741 67820742 67820743 传真:转分机805 值班电话:021-67820743
QQ:219854 Email:support@dns110.com