<SCRIPT Language="JavaScript">
<!--
var speed = 4000 //圖片切換時間
var img= new Array()
var url= new Array()
var current = 0
//一張圖片對應一個網址,可無限增加,編號由0開始
img[0] = new Image(); img[0].src = "news_img/01.jpg"; url[0] = "http://www.XX1.org.tw"
img[1] = new Image(); img[1].src = "news_img/02.jpg"; url[1] = "http://www.XX2.org.tw"
img[2] = new Image(); img[2].src = "news_img/03.jpg"; url[2] = "http://www.XX3.org.tw"
img[3] = new Image(); img[3].src = "news_img/04.jpg"; url[3] = "http://www.XX4.org.tw"
function start()
{
current++
if(current >=img.length) current = 0
document.imgs.src = img[current].src
setTimeout("start()",speed);
}
function cimgs(i)
{
current = i;
document.imgs.src = img[i].src;
}
function go() {
//window.location = url;
window.open(url[current],'','menubar=no,status=no,toolbar=no,width=1024,height=768').focus();
}
//-->
</SCRIPT>
<body onload="setTimeout('start()',speed)">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style=" font-size:12px">
<tr>
<td colspan="4" height="160" align="center">
<a href="javascript:go()"><img src="news_img/01.jpg" name="imgs" border="0"></a>
</td>
</tr>
<tr>
<td height="40" align="center">
<div id="imgA" onclick='cimgs(0);'>XX1</div>
</td>
<td height="40" align="center">
<div id="imgB" onclick='cimgs(1);'>XX2</div>
</td>
<td height="40" align="center">
<div id="imgC" onclick='cimgs(2);'>XX3</div>
</td>
<td height="40" align="center">
<div id="imgD" onclick='cimgs(3);'>XX4</div>
</td>
</tr>
</table>
沒有留言:
張貼留言