<!-- 滾動顯示最新公告 -->html
<td class="navmid2">app
<div id=marqueeBox style="overflow:hidden;height:23px" onMouseOver="clearInterval(marqueeInterval[0])" onMouseOut="marqueeInterval[0]=setInterval('startMarquee()',2000)"><div></div></div>ide
<script>post
var marqueeBox=document.getElementById("marqueeBox");spa
function sendURL(id){htm
window.showModalDialog("post/"+id+".html",window,"dialogWidth:520 px; dialogHeight:480 px; directories:no; localtion:no; menubar:no; status=no; toolbar=no; scrollbars:no;Resizeable=no");ip
}get
var marqueeContent=new Array();//滾動公告it
<logic:iterate id="b" name="bulletinList" indexId="i">io
marqueeContent[${i}]='<span class="post"><a bulletin.do?dispatch=userview&ID=${b.ID} target="rightFrame">${b.title}</a></span><br>';
</logic:iterate>
if(marqueeContent.length==0){
marqueeContent[0]='<span class="post">暫無公告</span><br>';
}
var marqueeInterval=new Array();
var marqueeId=0;
var marqueeDelay=2500;
var marqueeHeight=23;
function initMarquee() {
var str=marqueeContent[0];
marqueeId++;
marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
var str="";
if(marqueeContent[marqueeId]!= null){
str = marqueeContent[marqueeId];
}
marqueeId++;
if(marqueeId>=marqueeContent.length) marqueeId=0;
if(marqueeBox.childNodes.length==1) {
var nextLine=document.createElement('DIV');
nextLine.innerHTML=str;
marqueeBox.appendChild(nextLine);
} else {
marqueeBox.childNodes[0].innerHTML=str;
marqueeBox.appendChild(marqueeBox.childNodes[0]);
marqueeBox.scrollTop=0;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",23);
}
function scrollMarquee() {
marqueeBox.scrollTop++;
if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
clearInterval(marqueeInterval[1]);
}
}
initMarquee();
</script>
</td>