用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2822|回复: 1
收起左侧

script中的表格换行为什么什么都不显示了啊?

[复制链接]
发表于 2009-10-28 09:39:16 | 显示全部楼层 |阅读模式
eg:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0045)http://www.isoonsoo.co.kr/product_review.html -->
<HTML><HEAD><TITLE>连云港</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312" /><LINK
href="product_review.files/text.css" type=text/css rel=stylesheet />
<SCRIPT language=JavaScript>
<!--
var scrollerwidth=760
var scrollerheight=53
var scrollerbgcolor='#ffffff'  
var scrollerbackground=''  
var num = 2
var scrollspeed='3000'  
var waitingtime='0'   
var messages=new Array()
if (messages.length>1)
i=2
else
i=0
function move1(whichlayer){  
tlayer=eval(whichlayer)  
if (tlayer.top>0&&tlayer.top<=num){  
tlayer.top=0  
setTimeout("move1(tlayer)",scrollspeed)  
setTimeout("move2(document.main.document.second)",scrollspeed)  
return  
}  
if (tlayer.top>=tlayer.document.height*-1){  
tlayer.top-=num
setTimeout("move1(tlayer)",waitingtime)  
}  
else{  
tlayer.top=scrollerheight  
tlayer.document.write(messages)  
tlayer.document.close()  
if (i==messages.length-1)  
i=0  
else  
i++  
}  
}  
   
function move2(whichlayer){  
tlayer2=eval(whichlayer)  
if (tlayer2.top>0&&tlayer2.top<=num){  
tlayer2.top=0  
setTimeout("move2(tlayer2)",scrollspeed)  
setTimeout("move1(document.main.document.first)",scrollspeed)  
return  
}  
if (tlayer2.top>=tlayer2.document.height*-1){  
tlayer2.top-=num
setTimeout("move2(tlayer2)",waitingtime)  
}  
else{  
tlayer2.top=scrollerheight  
tlayer2.document.write(messages)  
tlayer2.document.close()  
if (i==messages.length-1)  
i=0  
else  
i++  
}  
}  
   
function move3(whichdiv){  
tdiv=eval(whichdiv)  
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=num){  
tdiv.style.pixelTop=0  
setTimeout("move3(tdiv)",scrollspeed)  
setTimeout("move4(second2)",scrollspeed)  
return  
}  
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){  
tdiv.style.pixelTop-=num
setTimeout("move3(tdiv)",waitingtime)  
}  
else{  
tdiv.style.pixelTop=scrollerheight  
tdiv.innerHTML=messages  
if (i==messages.length-1)  
i=0  
else  
i++  
}  
}  
   
function move4(whichdiv){  
tdiv2=eval(whichdiv)  
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=num){  
tdiv2.style.pixelTop=0  
setTimeout("move4(tdiv2)",scrollspeed)  
setTimeout("move3(first2)",scrollspeed)  
return  
}  
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){  
tdiv2.style.pixelTop-=num  
setTimeout("move4(second2)",waitingtime)  
}  
else{  
tdiv2.style.pixelTop=scrollerheight  
tdiv2.innerHTML=messages  
if (i==messages.length-1)  
i=0  
else  
i++  
}  
}  
   
function startscroll(){  
  if (document.all){  
  move3(first2)  
  second2.style.top=scrollerheight  
  second2.style.visibility='visible'  
  }  
  else if (document.layers){  
  document.main.visibility='show'  
  move1(document.main.document.first)  
  document.main.document.second.top=scrollerheight+num  
  document.main.document.second.visibility='show'  
  }  
     }
window.onload=startscroll
   
function go(url){
  parent.window.location.href=url;
}
//-->
</SCRIPT>
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
      <SCRIPT language=JavaScript>
  messages[0]="<table width='760' height='53' border='0' cellpadding='0' cellspacing='0'><tr><td rowspan='2'><img src='Img_01.jpg' width='175' height='50'></td><td><img src='Img_02.jpg' width='175' height='50'></td><td><img src='Img_03.jpg' width='175' height='50'></td><td><img src='Img_04.jpg' width='175' height='50'></td></tr><tr><td valign='top' class='td1'></td></tr></table>"     
     messages[1]="<table width='760' height='53' border='0' cellpadding='0' cellspacing='0' ><tr><td rowspan='2'><img src='Img_05.jpg' width='175' height='50'></td><td><img src='Img_04.jpg' width='175' height='50'></td><td><img src='Img_03.jpg' width='175' height='50'></td><td><img src='Img_02.jpg' width='175' height='50'></td></tr><tr><td valign='top' class='td1'><a href=javascript:go('#')></a></td></tr></table>"         
      if (document.all){
       document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
       document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
       document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
       document.write(messages[0])
       document.writeln('</div>')
        document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0;visibility:hidden">')
       document.write(messages[1])
       document.writeln('</div>')
       document.writeln('</div>')
       document.writeln('</span>')
      }
      
      //-->
      </SCRIPT>
</BODY></HTML>
把他保存为.htm文件,显示的是轮换显示的图片。
问题:
如果我在红色代码的地方换行,活着是任意的td代码处换行,那个轮换显示的图片就没了。为什么啊?
 楼主| 发表于 2009-10-28 09:40:59 | 显示全部楼层
请各位大侠踊跃提出你们高贵的看法,谢谢!

本版积分规则