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[id]#$announcement[id]" target="_blank">$announcement[subject]</a><!--{else}--><a href="$announcement[message]" target="_blank">$announcement[subject]</a><!--{/if}--></strong></th>
- <td class="by">
- <cite><a href="home.php?mod=space&uid=$announcement[authorid]" c="1">$announcement[author]</a></cite>
- <em>$announcement[starttime]</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[setting][bbname]</a><em>»</em><a href="forum.php">{$_G[setting][navs][2][navname]}</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[setting][bbname]</a><em>»</em><a href="forum.php">{$_G[setting][navs][2][navname]}</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[type] == 1}-->
- <a href="$zz_announcement[message]" target="_blank">$zz_announcement[subject]</a>
- <!--{else}-->
- <a href="forum.php?mod=announcement&id=$zz_announcement[id]" target="_blank" class="xi2">$zz_announcement[subject]</a>
- <!--{/if}-->
- <span>( <!--{echo dgmdate($zz_announcement[starttime], '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[0].offsetHeight;
- var timer2 = setInterval(function(){
- scrollnews.scrollTop = (++ml); if(ml == liHeight){ clearInterval(timer2);
- scrollnews.scrollTop = 0; ml = 0; lis[0].parentNode.appendChild(lis[0]); } },10);
- },5000
- );
- </script>
- </div>
- </div>
复制代码 最后网站更新模板缓存,即可。
|