想把兩個效果放在一起
單獨一個網頁沒有問題,但放在一起就有問題
我已經把變數到改掉了,但還是有錯誤
請高手指點
http://cdh.idv.tw/script/335.htm
滾單選向
http://cdh.idv.tw/script/114.htm
轉動LoGo連結
這兩個功能想把他放同一頁
分開放不同頁沒問題
放到同一頁就都不動了
PHP 語法:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>新增網頁3</title>
</head>
<body>
<table border="1" width="100%" id="table1">
<tr>
<td> <script language="JavaScript">
<!--
var scrollerwidth=60
var scrollerheight=145
var scrollerbgcolor='#F4F4F4'
var pausebetweenimages=5000
var slideimages=new Array()
slideimages[0]='<a href="http://tw.yahoo.com/" target="_blank">奇摩</a><br><br><a href="http://chinese.yahoo.com/" target="_blank">雅虎</a><br><br><a href="http://www.yam.com/" target="_blank">蕃薯藤</a><br><br><a href="http://www.sina.com.tw/" target="_blank">新浪網</a><br><br><a href="http://www.pchome.com.tw/" target="_blank">PChome</a>'
slideimages[1]='<a href="http://cdh.idv.tw" target="_blank">爪哇島</a><br><br><a href="http://cdh.idv.tw" target="_blank">爪哇島</a><br><br><a href="http://cdh.idv.tw" target="_blank">爪哇島</a><br><br><a href="http://cdh.idv.tw" target="_blank">爪哇島</a><br><br><a href="http://cdh.idv.tw" target="_blank">爪哇島</a>'
slideimages[2]='<a href="#">你的連結</a><br><br><a href="#">你的連結</a><br><br><a href="#">你的連結</a><br><br><a href="#">你的連結</a><br><br><a href="#">你的連結</a>'
if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=4){
tlayer.top=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=4
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=4){
tlayer2.top=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=4
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=4){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(second2)",pausebetweenimages)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=4
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=4){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(first2)",pausebetweenimages)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=4
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
if (document.layers)
document.write(slideimages[0])
if (document.layers)
document.write(slideimages[1])
if (document.layers)
document.write(slideimages[0])
if (document.all){
document.writeln('<center><span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div align="left" style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div align="left" id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div align="left" id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span></center>')
}
-->
</script>
</td>
<td>
<script language=JavaScript1.2>
<!--
var scrollerwidth_2=88
var scrollerheight_2=31
var scrollerbgcolor_2='white'
var pausebetweenimages_2=1000
var slideimages_2=new Array()
slideimages_2[0]='<a href="http://www.sina.com.tw/" target="_blank"><img src="http://www.sina.com.tw/service/sina_logo.gif" border=0 alt="新浪網"></a>'
slideimages_2[1]='<a href="http://cdh.idv.tw" target="_blank"><img src="http://cdh.idv.tw/logo.gif" border=0 alt="爪哇島"></a>'
slideimages_2[2]='<a href="http://www.sina.com.tw/" target="_blank"><img src="http://www.sina.com.tw/service/sina_logo.gif" border=0 alt="新浪網"></a>'
slideimages_2[3]='<a href="http://cdh.idv.tw" target="_blank"><img src="http://cdh.idv.tw/logo.gif" border=0 alt="爪哇島"></a>'
if (slideimages_2.length>1)
j=2
else
j=0
function move1_2(whichlayer_2){
tlayer_2=eval(whichlayer_2)
if (tlayer_2.top>0&&tlayer_2.top<=5){
tlayer_2.top=0
setTimeout("move1_2(tlayer_2)",pausebetweenimages_2)
setTimeout("move2_2(document.main.document.second)",pausebetweenimages_2)
return
}
if (tlayer_2.top>=tlayer_2.document.height*-1){
tlayer_2.top-=5
setTimeout("move1_2(tlayer_2)",100)
}
else{
tlayer_2.top=scrollerheight_2
tlayer_2.document.write(slideimages_2[j])
tlayer_2.document.close()
if (j==slideimages_2.length-1)
j=0
else
j++
}
}
function move2_2(whichlayer_2){
tlayer_22=eval(whichlayer_2)
if (tlayer_22.top>0&&tlayer_22.top<=5){
tlayer_22.top=0
setTimeout("move2_2(tlayer_22)",pausebetweenimages_2)
setTimeout("move1_2(document.main.document.first)",pausebetweenimages_2)
return
}
if (tlayer_22.top>=tlayer_22.document.height*-1){
tlayer_22.top-=5
setTimeout("move2_2(tlayer_22)",100)
}
else{
tlayer_22.top=scrollerheight_2
tlayer_22.document.write(slideimages_2[j])
tlayer_22.document.close()
if (j==slideimages_2.length-1)
j=0
else
j++
}
}
function move3_2(whichdiv_2){
tdiv_2=eval(whichdiv_2)
if (tdiv_2.style.pixelTop>0&&tdiv_2.style.pixelTop<=5){
tdiv_2.style.pixelTop=0
setTimeout("move3_2(tdiv_2)",pausebetweenimages_2)
setTimeout("move4_2(second2_2)",pausebetweenimages_2)
return
}
if (tdiv_2.style.pixelTop>=tdiv_2.offsetHeight*-1){
tdiv_2.style.pixelTop-=5
setTimeout("move3_2(tdiv_2)",100)
}
else{
tdiv_2.style.pixelTop=scrollerheight_2
tdiv_2.innerHTML=slideimages_2[j]
if (j==slideimages_2.length-1)
j=0
else
j++
}
}
function move4_2(whichdiv_2){
tdiv_22=eval(whichdiv_2)
if (tdiv_22.style.pixelTop>0&&tdiv_22.style.pixelTop<=5){
tdiv_22.style.pixelTop=0
setTimeout("move4_2(tdiv_22)",pausebetweenimages_2)
setTimeout("move3_2(first2)",pausebetweenimages_2)
return
}
if (tdiv_22.style.pixelTop>=tdiv_22.offsetHeight*-1){
tdiv_22.style.pixelTop-=5
setTimeout("move4_2(second2_2)",100)
}
else{
tdiv_22.style.pixelTop=scrollerheight_2
tdiv_22.innerHTML=slideimages_2[j]
if (j==slideimages_2.length-1)
j=0
else
j++
}
}
function startscroll(){
if (document.all){
move3_2(first2)
second2_2.style.top=scrollerheight_2
}
else if (document.layers){
move1_2(document.main.document.first)
document.main.document.second.top=scrollerheight_2+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
-->
</script>
<ilayer id="main" width=&{scrollerwidth_2}; height=&{scrollerheight_2}; bgcolor=&{scrollerbgcolor_2};>
<layer id="first" left=0 top=1 width=&{scrollerwidth_2};>
<script language="JavaScript1.2">
if (document.layers)
document.write(slideimages_2[0])
</script>
</layer>
<layer id="second" left=0 top=0 width=&{scrollerwidth_2}; visibility=hide>
<script language="JavaScript1.2">
if (document.layers)
document.write(slideimages_2[1])
</script>
</layer>
</ilayer>
<p>
<CENTER>
<script language="JavaScript1.2">
<!--
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth_2+';height:'+scrollerheight_2+';overflow:hiden;background-color:'+scrollerbgcolor_2+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth_2+';height:'+scrollerheight_2+';clip:rect(0 '+scrollerwidth_2+' '+scrollerheight_2+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth_2+';left:0;top:1;">')
document.write(slideimages_2[0])
document.writeln('</div>')
document.writeln('<div id="second2_2" style="position:absolute;width:'+scrollerwidth_2+';left:0;top:0">')
document.write(slideimages_2[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
-->
</script>
</td>
</tr>
</table>
</body>
</html>