Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] DIY仿新浪微博广场记录动态滚动,渐变滚动效果,让网友互动起来

[复制链接]
sfqzone 发表于 2011-12-19 20:21:14 | 显示全部楼层 |阅读模式
本帖最后由 sfqzone 于 2011-12-21 13:41 编辑

大家要看演示的进我的演示站看吧
丝女郎http://www.sinvlang.com/forum.php

截图如下。是滚动的。截图只是静态图片。具体要看演示

DIY仿新浪微博广场记录动态滚动
看到一网友在秀他的的记录滚动,于是自己便弄了一个。方便 大家去调用。由于 是滚动动画形式的。截图不好演示

DYI插入以下代码即可,



  1. <style type="text/css">

  2. ul,li{margin:0;padding:0;list-style:none;}

  3. .wplck{position:relative;height:100px;overflow:hidden;margin:0px auto;border:4px }

  4. .sliderlck{position:absolute;width:95%;padding:0 10px;left:0;top:0;}

  5. .fllck{float:left;}

  6. .sliderlck img{display:block;padding:2px;border:1px solid #ccc;}

  7. .sliderlck li{padding:6px 0;border-bottom:1px dashed #ccc;overflow:hidden;width:100%;}

  8. .sliderlck p{font-size:10px;margin:0;padding-left:46px;color:#333;line-height:18px;}

  9. </style>

  10. <script type="text/javascript">

  11. function H$(i) {return document.getElementById(i)}

  12. function H$(c, p) {return p.getElementsByTagName(c)}

  13. var sliderlck = function () {

  14.         function init (o) {

  15.                 this.id = o.id;

  16.                 this.at = o.auto ? o.auto : 3;

  17.                 this.o = 0;

  18.                 this.pos();

  19.         }

  20.         init.prototype = {

  21.                 pos : function () {

  22.                         clearInterval(this.__b);

  23.                         this.o = 0;

  24.                         var el = H$(this.id), li = H$('li', el), l = li.length;

  25.                         var _t = li[l-1].offsetHeight;

  26.                         var cl = li[l-1].cloneNode(true);

  27.                         cl.style.opacity = 0; cl.style.filter = 'alpha(opacity=0)';

  28.                         el.insertBefore(cl, el.firstChild);

  29.                         el.style.top = -_t + 'px';

  30.                         this.anim();

  31.                 },

  32.                 anim : function () {

  33.                         var _this = this;

  34.                         this.__a = setInterval(function(){_this.animH()}, 20);

  35.                 },

  36.                 animH : function () {

  37.                         var _t = parseInt(H$(this.id).style.top), _this = this;

  38.                         if (_t >= -1) {

  39.                                 clearInterval(this.__a);

  40.                                 H$(this.id).style.top = 0;

  41.                                 var list = H$('li',H$(this.id));

  42.                                 H$(this.id).removeChild(list[list.length-1]);

  43.                                 this.__c = setInterval(function(){_this.animO()}, 20);

  44.                                 //this.auto();

  45.                         }else {

  46.                                 var __t = Math.abs(_t) - Math.ceil(Math.abs(_t)*.07);

  47.                                 H$(this.id).style.top = -__t + 'px';

  48.                         }

  49.                 },

  50.                 animO : function () {

  51.                         this.o += 2;

  52.                         if (this.o == 100) {

  53.                                 clearInterval(this.__c);

  54.                                 H$('li',H$(this.id))[0].style.opacity = 1;

  55.                                 H$('li',H$(this.id))[0].style.filter = 'alpha(opacity=100)';

  56.                                 this.auto();

  57.                         }else {

  58.                                 H$('li',H$(this.id))[0].style.opacity = this.o/100;

  59.                                 H$('li',H$(this.id))[0].style.filter = 'alpha(opacity='+this.o+')';

  60.                         }

  61.                 },

  62.                 auto : function () {

  63.                         var _this = this;

  64.                         this.__b = setInterval(function(){_this.pos()}, this.at*1000);

  65.                 }

  66.         }

  67.         return init;

  68. }();

  69. </script>

  70. <div class="wplck">

  71.         <ul id="sliderlck" class="sliderlck">[loop]<li>

  72. <a class="fllck" href="home.php?mod=space&uid={uid}"  target="_blank"><img src="{avatar}" width="33" height="33" alt="{username}" /></a>

  73. <p><a href="home.php?mod=space&uid={uid}"  target="_blank">{username}</a>:{title}</p>

  74. <p><em class="xg1 xw0">{dateline}</em> <a style="color:#6EAFD5" href="{url}" target="_blank">[回复]</a>

  75. </li>[/loop]</ul>

  76. </div>

  77. <script type="text/javascript">

  78. new sliderlck({id:'sliderlck'})

  79. </script>
复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
无效楼层,该帖已经被删除
ppcynt 发表于 2011-12-19 20:49:28 | 显示全部楼层
回复

使用道具 举报

plotworld.cn 发表于 2011-12-20 10:05:26 | 显示全部楼层
:$
回复

使用道具 举报

a475305268 发表于 2011-12-20 10:12:01 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

sky2227 发表于 2011-12-20 10:41:40 | 显示全部楼层
没看到滚动哦
回复

使用道具 举报

sky2227 发表于 2011-12-20 10:41:40 | 显示全部楼层
没看到滚动哦
回复

使用道具 举报

shao326781 发表于 2011-12-20 15:30:49 | 显示全部楼层
我也是没看到滚动 www.gogoyn.com
回复

使用道具 举报

天府缘分 发表于 2012-3-9 02:10:47 | 显示全部楼层
我试了,错误!!调不出来!!
回复

使用道具 举报

10#
无效楼层,该帖已经被删除
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 06:20 , Processed in 0.446005 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表