超酷论坛公告美化! FreeDiscuz 仿 滚动式公告!
上一篇 /
下一篇 2006-12-21 10:47:24
查看( 15506 ) /
评论( 154 )
D5 版公告滚动 已发布!
http://www.discuz.net/thread-489154-1-1.html
效果说明:论坛公告 向上滚动一条 停止 3秒 继续滚下条!再停 !效果好很好!
演示
http://www.aodot.net 只看公告部分哦!
技术支持
零点迷雾论坛适用版本:4.0 4.1 通用
需要修改部分:模板 index.htm
主目录 index.php
打开index.php
查找
CODE:
<a href="announcement.php?id='.$announcement['id'].'#'.$announcement['id'].'"><span class="bold">'.$announcement['subject'].'</span> '.'('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</a>在后面(不是下面)添加:
CODE:
<br>打开模板 index.htm
查找
CODE:
<marquee direction="left" scrollamount="3" ōnMouseOver="this.stop();" ōnMouseOut="this.start();">
$announcements
</marquee>修改为
CODE:
<div id="so1">
$announcements
</div><div id='so2' style='position:absolute;z-index:1;visibility:hidden'></div>
<scrīpt>
marqueesHeight=16;
stopscroll=false;
document.all.so1.scrollTop=0;
with(so1){
style.width=776;
style.height=marqueesHeight;
style.overflowX='visible';
style.overflowY='hidden';
noWrap=true;
onmouseover=new Function('stopscroll=true');
onmouseout=new Function('stopscroll=false');
}
preTop=0; currentTop=0; stoptime=0;
function init_srolltext(){
document.all.so2.innerHTML='';
document.all.so2.innerHTML+=document.all.so1.innerHTML;
document.all.so1.innerHTML=document.all.so2.innerHTML+document.all.so2.innerHTML;
setInterval('scrollUp()',1);
}
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==16)
{
stoptime+=1;
currentTop-=1;
if(stoptime==300)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=document.all.so1.scrollTop;
document.all.so1.scrollTop+=1;
if(preTop==document.all.so1.scrollTop){
document.all.so1.scrollTop=document.all.so2.offsetHeight-marqueesHeight;
document.all.so1.scrollTop+=1;
}
}
}
setTimeout('init_srolltext()', 3000)
</scrīpt>部分论坛可能滚动次数多了会发生位移 可以修改 marqueesHeight=16; 将数字改为15测试下!
本人第一次在DZ发布插件 大家多多支持啊!
[
本帖最后由 零点迷雾 于 2006-12-21 10:35 编辑 ]
论坛模式
推荐
收藏
分享给好友
管理
TAG: