展会信息港展会大全

js 文字滚动效果 android软件开发教程
来源:互联网   发布日期:2016-03-25 16:14:59   浏览:2340次  

导读:这是一款仿猪八戒网左下角的文字滚动效果效果,以前觉得很不错,今天特意搞来下,有需要的朋友可以参考一下。代码如下复制代码 *{padding:0;margin:0;...

这是一款仿猪八戒网左下角的文字滚动效果效果,以前觉得很不错,今天特意搞来下,有需要的朋友可以参考一下。

代码如下

复制代码

*{padding:0;margin:0;font-size:12px;}

.do_ta { border: 1px solid #E4E4E4; margin:10px auto; width:170px; }

.do_ta .ta_ta { background: url("http://s.zbjimg.com/p/zbj/css/../img/tafb.gif") no-repeat; height: 52px; width: 168px; }

.do_ta .ta_tc { height: 61px; line-height: 20px; margin: 10px; overflow: hidden; padding: 0;position:relative; }

.do_ta .ta_tc li { border-bottom: 1px dashed #E4E4E4; color: #666666; height: 60px; margin: 0; overflow: hidden; padding: 0;position:absolute;top:0;left:0;background:#fff;z-index:0;width:155px; }

.do_ta .ta_tc li .time { color: #999999; }

.do_ta .ta_tc li u { color: #2B9A00; text-decoration:none;}

.do_ta .ta_tc li s { color: #FF3600; text-decoration:none;}

.do_ta .ta_tc li a { color: #1A69DE;text-decoration:none; }

.do_ta .dota_d { padding: 5px 0 15px; text-align: center; }

.do_ta .dota_d a{color:#666;}

js代码

代码如下

复制代码

Meng.extend({

zbjScrollText:function(scrollId){

var li = Meng.getTag('li',Meng.getId(scrollId)),

curActLi = 0,

getActivity = function(){

return [li[curActLi],li[10+curActLi],li[20+curActLi],li[30+curActLi]];

},

sliceDown = function(elem,pos){

Meng.setStyle(elem,{top:'-60px',zIndex:1});

Meng.animate(elem,{top:-60},{top:60},800);

},

play = function(){

Meng.each(getActivity(),function(i){

var _this = this;

setTimeout(function(){

sliceDown(_this,i);

},i*900);

});

};

play();

setInterval(function(){

if(curActLi == 9){

curActLi = 0;

Meng.each(li,function(){Meng.setStyle(this,{zIndex:0})});

}else curActLi++;

play();

},5000);

}

});

Meng.zbjScrollText('dota1');

赞助本站

人工智能实验室

相关热词: 开发 编程 android

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港