列印

論壇公告訊息框

論壇公告訊息框

蠻簡單的
首頁上加公告訊息框.或會員注意事項

演示http://myth.servegame.com

首先在templates\default\discuz.htm

複製內容到剪貼簿
代碼:
<!--{if empty($gid) && $announcements}-->
        <div id="announcement" onmouseover="if(!anncount) {clearTimeout(annst);annst = 0}" onmouseout="if(!annst) annst = setTimeout('announcementScroll()', anndelay);">
                <div id="announcementbody"><ul>$announcements</ul></div>
        </div>
        <script type="text/javascript">
                var anndelay = 3000;
                var anncount = 0;var annheight = 36;var annst = 0;
                function announcementScroll() {
                        if(!annst) {
                                $('announcementbody').innerHTML += '
' + $('announcementbody').innerHTML;$('announcementbody').scrollTop = 0;
                                if($('announcementbody').scrollHeight > annheight * 3) {
                                        annst = setTimeout('announcementScroll()', anndelay);
                                } else {
                                        $('announcement').onmouseover = $('announcement').onmouseout = null;
                                }
                                return;
                        }
                        if(anncount == annheight) {
                                if($('announcementbody').scrollHeight - annheight <= $('announcementbody').scrollTop) {
                                        $('announcementbody').scrollTop = $('announcementbody').scrollHeight / 2 - annheight;
                                }
                                anncount = 0;annst = setTimeout('announcementScroll()', anndelay);
                        } else {
                                $('announcementbody').scrollTop++;anncount++;annst = setTimeout('announcementScroll()', 10);
                        }
                }

        </script>
<!--{/if}-->
下加
引用:
<div class="box">
        <span class="headactions"><img id="registernew_img" src="{IMGDIR}/collapsed_no.gif" alt="" onclick="toggle_collapse('registernew');" /></span>
        <h4>論壇公告</h4>
<table class="portalbox" cellspacing="0" cellpadding="0" id="forumfour" border="0">
<tr>
<td width="100%">
<table style="border:1px solid #777777;" bgcolor="black">
<td>
<marquee scrollamount='1' scrolldelay='60' direction= 'up' width='300' id=xiaoqing height='120' onmouseover=xiaoqing.stop() onmouseout=xiaoqing.start()>
<BR>加你想加的訊息
<BR>     
<BR>加你想加的訊息
<BR>
<BR>本人無聊用用
<BR>
<BR>如有不好的地方請多多包含
<BR>

</marquee>
</td>
</table>
</td>
</tr>
</table>
</div>
完成

[ 本帖最後由 kazo 於 2007-9-30 06:25 AM 編輯 ]
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)