日期:2014-05-16  浏览次数:20346 次

求解技术问题
首先页面上有
HTML code

<div  id="test1" style="display:none"><script language="javascript" src="http://www.chinabesi.com/data/js.php?id=8"></script></div>
<div  id="test2" style="display:none"><script language="javascript" src="http://www.chinabesi.com/data/js.php?id=17"></script></div>
<div  id="test3" style="display:none"><script language="javascript" src="http://www.chinabesi.com/data/js.php?id=18"></script></div>
<div  id="test4" style="display:none"><script language="javascript" src="http://www.chinabesi.com/data/js.php?id=19"></script></div>


他们每个生成的结构如下:
HTML code

<div  id="test1" style="display:none><div><img src="图片路径"></div></div>
<div  id="test2" style="display:none><div><img src="图片路径"></div></div>
<div  id="test3" style="display:none><div><img src="图片路径"></div></div>
<div  id="test4" style="display:none><div><img src="图片路径"></div></div>


我下面有段代码如:
JScript code

<SCRIPT>
var SlideShowSpeed = 3000;
var CrossFadeDuration = 3;
var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
//下面是我用来取那四个DIV下面的img的src值的代码
var srcs1 = document.getElementById("test1").getElementsByTagName("img")[0].src;
var srcs2 = document.getElementById("test2").getElementsByTagName("img")[0].src;
var srcs3 = document.getElementById("test3").getElementsByTagName("img")[0].src;
var srcs4 = document.getElementById("test4").getElementsByTagName("img")[0].src;
//上面的取值把值付给Picture[1]Picture[2]Picture[3]Picture[4]

Picture[1]  = 'zp1.files/1.jpg';
Picture[2]  = 'zp1.files/2.jpg';
Picture[3]  = 'zp1.files/3.jpg';
Picture[4]  = 'zp1.files/4.jpg';



var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}
</SCRIPT>


我这样写总报错,求高手帮我写一下

------解决方案--------------------
HTML code
//下面是我用来取那四个DIV下面的img的src值的代码
var srcs1 = document.getElementById("test1").getElementsByTagName("img")[0].src;
var srcs2 = document.getElementById("test2").getElementsByTagName("img")[0].src;
var srcs3 = document.getElementById("test3").getElementsByTagName("img")[0].src;
var srcs4 = document.getElementById("test4").getElementsByTagName("img")[0].src;

------解决方案--------------------
style="display:none
右侧少了半个引号

改成style="dis