discuz!X3.5论坛建站版块主题列表站点公告滚动显示
discuz!X3.5论坛建站版块主题列表站点公告滚动显示首先打开文件template/default/forum/forumdisplay_list.htm(做好备份),找到下面代码删除
<!--{if (!$simplestyle || !$_G['forum']['allowside'] && $page == 1) && !empty($announcement)}-->
<tbody>
<tr>
<td class="icn"><i class="fico-volume fic6 fc-i" title="{lang announcement}"></i></td>
<!--{if $_G['forum']['ismoderator'] && !$_GET['archiveid']}--><td class="o"> </td><!--{/if}-->
<th><strong class="xst">{lang announcement}: <!--{if empty($announcement['type'])}--><a href="forum.php?mod=announcement&id=$announcement#$announcement" target="_blank">$announcement</a><!--{else}--><a href="$announcement" target="_blank">$announcement</a><!--{/if}--></strong></th>
<td class="by">
<cite><a href="home.php?mod=space&uid=$announcement" c="1">$announcement</a></cite>
<em>$announcement</em>
</td>
<td class="num"> </td>
<td class="by"> </td>
</tr>
</tbody>
<!--{/if}-->然后打开文件template/default/forum/forumdisplay.htm(做好备份),找到下面代码
<div id="pt" class="bm cl">
<div class="z">
<a href="./" class="nvhm" title="{lang homepage}">$_G</a><em>»</em><a href="forum.php">{$_G}</a>$navigation
</div>
</div>复制下面2楼代码,替换上面的代码
<style>
.zz_roll_ann{height: 29px;line-height: 29px; overflow:hidden}
.zz_roll_ann li{height: 29px;line-height: 29px; text-align: right; }
.zz_roll_ann li a { max-width: 620px; height: 29px;line-height: 29px;margin-right: 5px; white-space: nowrap; text-overflow:ellipsis; overflow:hidden;}
.zz_roll_ann li span{color: #999;}
</style>
<div id="pt" class="bm cl">
<div class="z">
<a href="./" class="nvhm" title="{lang homepage}">$_G</a><em>»</em><a href="forum.php">{$_G}</a>$navigation
</div>
<div class="y">
<!--{eval $zz_gonggao = DB::fetch_all("SELECT * FROM ".DB::table('forum_announcement')." WHERE `displayorder` = 0");}-->
<ul id="zz_roll_ann" class="zz_roll_ann">
<!--{loop $zz_gonggao $zz_announcement}-->
<li>
<!--{if $zz_announcement == 1}-->
<a href="$zz_announcement" target="_blank">$zz_announcement</a>
<!--{else}-->
<a href="forum.php?mod=announcement&id=$zz_announcement" target="_blank" class="xi2">$zz_announcement</a>
<!--{/if}-->
<span>( <!--{echo dgmdate($zz_announcement, 'u', '9999', getglobal('setting/dateformat'))}--> )</span>
</li>
<!--{/loop}-->
</ul>
<script type="text/javascript">
var scrollnews = document.getElementById('zz_roll_ann');
var lis = scrollnews.getElementsByTagName('li');
var ml = 0; var timer1 = setInterval(function(){ var liHeight = lis.offsetHeight;
var timer2 = setInterval(function(){
scrollnews.scrollTop = (++ml); if(ml == liHeight){ clearInterval(timer2);
scrollnews.scrollTop = 0; ml = 0; lis.parentNode.appendChild(lis); } },10);
},5000
);
</script>
</div>
</div>
最后网站更新模板缓存,即可。
页:
[1]