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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖

[求助] 求2.5 首页记录或心情广播向上滚动代码

[复制链接]
xskwy 发表于 2012-8-26 11:06:19 | 显示全部楼层
给你增加点人气
回复

使用道具 举报

 楼主| メ.i_渐行渐远的 发表于 2012-8-26 15:45:30 | 显示全部楼层
新DIY一个记录模板,点模板属性,把下面的这些代码覆盖进去。


<style type="text/css">
ul,li{list-style:none;}
.wplck{position:relative;height:245px;overflow:hidden;margin:0px auto; }
.sliderlck{position:absolute;width:100%;}
.fllck{float:left;}
.sliderlck img{display:block;padding:2px;border:1px solid #ccc;}
.sliderlck li{padding:5px 0;border-bottom:1px dashed #ccc;overflow:hidden;width:100%;}
.sliderlck p{font-size:12px;padding-left:46px;color:#666;line-height:18px;}
</style>
<script type="text/javascript">
function H$(i) {return document.getElementById(i)}
function H$$(c, p) {return p.getElementsByTagName(c)}
var sliderlck = function () {
function init (o) {
this.id = o.id;
this.at = o.auto ? o.auto : 3;
this.o = 0;
this.pos();
}
init.prototype = {
pos : function () {
clearInterval(this.__b);
this.o = 0;
var el = H$(this.id), li = H$$('li', el), l = li.length;
var _t = li[l-1].offsetHeight;
var cl = li[l-1].cloneNode(true);
cl.style.opacity = 0; cl.style.filter = 'alpha(opacity=0)';
el.insertBefore(cl, el.firstChild);
el.style.top = -_t + 'px';
this.anim();
},
anim : function () {
var _this = this;
this.__a = setInterval(function(){_this.animH()}, 20);
},
animH : function () {
var _t = parseInt(H$(this.id).style.top), _this = this;
if (_t >= -1) {
clearInterval(this.__a);
H$(this.id).style.top = 0;
var list = H$$('li',H$(this.id));
H$(this.id).removeChild(list[list.length-1]);
this.__c = setInterval(function(){_this.animO()}, 20);
//this.auto();
}else {
var __t = Math.abs(_t) - Math.ceil(Math.abs(_t)*.07);
H$(this.id).style.top = -__t + 'px';
}
},
animO : function () {
this.o += 2;
if (this.o == 100) {
clearInterval(this.__c);
H$$('li',H$(this.id))[0].style.opacity = 1;
H$$('li',H$(this.id))[0].style.filter = 'alpha(opacity=100)';
this.auto();
}else {
H$$('li',H$(this.id))[0].style.opacity = this.o/100;
H$$('li',H$(this.id))[0].style.filter = 'alpha(opacity='+this.o+')';
}
},
auto : function () {
var _this = this;
this.__b = setInterval(function(){_this.pos()}, this.at*1000);
}
}
return init;
}();
</script>
</head>

<div class="wplck">
<ul id="sliderlck" class="sliderlck">
[loop]
<li>
<a class="fllck" href="home.php?mod=space&uid={uid}" {target}><img src="{avatar}" width="33" height="33" alt="{username}" /></a>
<p><a href="home.php?mod=space&uid={uid}" title="{username}"{target}>{username}</a>:{title}</p>
<p><em class="xg1 xw0">{dateline}</em> <a style="color:#6EAFD5" href="{url}"{target}>[回复]</a></p>
</li>
[/loop]
</ul>
</div>
<script type="text/javascript">
new sliderlck({id:'sliderlck'})
</script>

这是使用的代码
回复

使用道具 举报

小小太 发表于 2012-8-26 18:32:00 | 显示全部楼层
{:soso_e617:}           没人哦 睡觉了先
回复

使用道具 举报

xghomtel 发表于 2012-8-26 23:10:15 | 显示全部楼层
  1. <script type="text/javascript">
  2. function H$(i) {return document.getElementById(i)}
  3. function H$$(c, p) {return p.getElementsByTagName(c)}
  4. var sliderlck = function () {
  5. function init (o) {
  6. this.id = o.id;
  7. this.at = o.auto ? o.auto : 3;
  8. this.o = 0;
  9. this.pos();
  10. }
  11. init.prototype = {
  12. pos : function () {
  13. clearInterval(this.__b);
  14. this.o = 0;
  15. var el = H$(this.id), li = H$$('li', el), l = li.length;
  16. var _t = li[l-1].offsetHeight;
  17. var cl = li[l-1].cloneNode(true);
  18. cl.style.opacity = 0; cl.style.filter = 'alpha(opacity=0)';
  19. el.insertBefore(cl, el.firstChild);
  20. el.style.top = -_t + 'px';
  21. this.anim();
  22. },
  23. anim : function () {
  24. var _this = this;
  25. this.__a = setInterval(function(){_this.animH()}, 20);
  26. },
  27. animH : function () {
  28. var _t = parseInt(H$(this.id).style.top), _this = this;
  29. if (_t >= -1) {
  30. clearInterval(this.__a);
  31. H$(this.id).style.top = 0;
  32. var list = H$$('li',H$(this.id));
  33. H$(this.id).removeChild(list[list.length-1]);
  34. this.__c = setInterval(function(){_this.animO()}, 20);
  35. //this.auto();
  36. }else {
  37. var __t = Math.abs(_t) - Math.ceil(Math.abs(_t)*.07);
  38. H$(this.id).style.top = -__t + 'px';
  39. }
  40. },
  41. animO : function () {
  42. this.o += 2;
  43. if (this.o == 100) {
  44. clearInterval(this.__c);
  45. H$$('li',H$(this.id))[0].style.opacity = 1;
  46. H$$('li',H$(this.id))[0].style.filter = 'alpha(opacity=100)';
  47. this.auto();
  48. }else {
  49. H$$('li',H$(this.id))[0].style.opacity = this.o/100;
  50. H$$('li',H$(this.id))[0].style.filter = 'alpha(opacity='+this.o+')';
  51. }
  52. },
  53. auto : function () {
  54. var _this = this;
  55. this.__b = setInterval(function(){_this.pos()}, this.at*1000);
  56. }
  57. }
  58. return init;
  59. }();
  60. </script>
  61. <div class="wplck">
  62. <ul id="sliderlck" class="sliderlck">[loop]
  63. <li>
  64. <dt><a href="home.php?mod=space&uid={uid}" {target}><img src="{avatar}" width="{picwidth}" height="{picheight}" /></a></dt>
  65. <dd><span><img src="static/image/yesmmc/img/icon_blog.png" align="absmiddle"> <a href="{url}"{target}>{title}</a></span><span><em>{dateline}</em><a href="home.php?mod=space&uid={uid}" {target} class="user">{username}</a></span></dd>
  66. </li>


  67. [/loop]</ul>
  68. </div>
  69. <script type="text/javascript">
  70. new sliderlck({id:'sliderlck'})
  71. </script>
复制代码
我自己模版上在用的,希望你也能用!演示:www.up97.com
回复

使用道具 举报

 楼主| メ.i_渐行渐远的 发表于 2012-8-28 19:32:20 | 显示全部楼层
xghomtel 发表于 2012-8-26 23:10
我自己模版上在用的,希望你也能用!演示:www.up97.com

兄弟能不能把你COMMON.CSS 里面相关的代码给我看下,
我这边基本能成了
回复

使用道具 举报

gx18 发表于 2012-10-23 10:42:47 | 显示全部楼层
如何在论坛的帖子使用,让帖子滚动,谢谢!!!!!
回复

使用道具 举报

ohalu 发表于 2013-4-20 13:47:52 | 显示全部楼层
メ.i_渐行渐远的 发表于 2012-8-26 15:45
新DIY一个记录模板,点模板属性,把下面的这些代码覆盖进去。

想在门户加上记录输入框。

也就是说,在门户就可以更新记录和发布,而不需要跑到家园里面去。

请问用什么样的代码?用的是dx2.5。谢谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-9-22 01:17 , Processed in 0.169817 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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