keroro 2008-3-27 20:54
論壇公告訊息框
論壇公告訊息框蠻簡單的
在首頁上加公告訊息框.或會員注意事項
首先在templates\default\discuz.htm
找
<!--{if empty($gid) && $announcements}-->
<div id="announcement" >
<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="" /></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()>
加你想加的訊息
加你想加的訊息
本人無聊用用
如有不好的地方請多多包含
</marquee>
</td>
</table>
</td>
</tr>
</table>
</div>
[size=6]完成[/size]