这段代码翻转了World History课程的图片。我已经从页面上删除了代码,但页面仍然没有 函数。 我是JS的新手虽然我明白我在看什么,但我不会理解为什么它不起作用。 有人可以帮我吗? Wade < HTML> < HEAD> < TITLE> CountDown< / TITLE> < script language =" JavaScript"> <! - 隐藏其他浏览器 //图片到切换中间 var Rollpic1 =" 1.jpg" var Rollpic2 =" 2.jpg"; var Rollpic3 =" 3.jpg"; var Rollpic4 =" 4.jpg" ;; //从图片开始: var PicNumber = AD1.png; //图片数量: var NumberOfPictures = 4; //图片切换秒之间的时间 var HowLongBetweenPic = 5; // Switc hPic函数 函数SwitchPic(计数器){ if(counter< HowLongBetweenPic){ counter ++; //屏幕底部状态栏中的DEBUG window.status ="在5处切换图片:" + counter +" PicNumber: " + PicNumber +" " ;; //在< IMG>中显示图片标签卷是我所谓的图像 document.roll.src = eval(" Rollpic" + PicNumber); //函数调用自身 CallSwitchPic = window.setTimeout(" SwitchPic(" + count er +")",1500); } else { //如果它不是最后一张图片转到下一张图片 if(PicNumber< NumberOfPictures){ PicNumber ++; SwitchPic(0); } //最后一张图片转到第一张图片 else { PicNumber = 1; SwitchPic(0); } } } //停止隐藏旧浏览器 - > < / script> < / HEAD> < BODY onLoad =" SwitchPic(0)"> < img src =" 1.jpg"边界=" 0" name =" roll"> < / BODY> < / HTML>08122005 1505 GMT-5Hello. I am working on a webpage for the local school (just beforeschool starts). Their outside hired company really screwed things up.Im trying to get their computers up and running and gain access totheir apps for them.There is this code that flips through images for World History class. Ihave removed the code from the page but the page still does notfunction.Im so very new to JS that while I understand what Im viewing, I do notunderstand why it doesnt work.Could somebody help me on this?Wade<HTML><HEAD><TITLE>CountDown</TITLE><script language="JavaScript"><!-- hide from other browsers//Pictures to switch inbetweenvar Rollpic1 = "1.jpg"var Rollpic2 = "2.jpg";var Rollpic3 = "3.jpg";var Rollpic4 = "4.jpg";//Start at the what pic:var PicNumber=AD1.png;//Number of pics:var NumberOfPictures=4;//Time between pics switching in secsvar HowLongBetweenPic=5;//SwitchPic Functionfunction SwitchPic(counter){if(counter < HowLongBetweenPic){counter++;//DEBUG in the status bar at the bottom of the screenwindow.status="Switch picture at 5 : "+counter+" PicNumber:"+PicNumber+" ";//Display pic in what <IMG> tag roll is what I called the imagedocument.roll.src = eval("Rollpic" + PicNumber);//function calls itselfCallSwitchPic=window.setTimeout("SwitchPic("+count er+")",1500);}else{//if its not the last picture goto the next pictureif(PicNumber < NumberOfPictures){PicNumber++;SwitchPic(0);}//its the last picture go to the first oneelse{PicNumber=1;SwitchPic(0);}}}// Stop hiding from old browsers --></script></HEAD><BODY onLoad="SwitchPic(0)"><img src="1.jpg" border="0" name="roll"></BODY></HTML>推荐答案" Wade" < WA ** @ wadesmart.com>在消息中写道 news:11 ********************** @ g43g2000cwa.googlegr oups.com ..."Wade" <wa**@wadesmart.com> wrote in messagenews:11**********************@g43g2000cwa.googlegr oups.com... 08122005 1505 GMT-5 你好。我正在为当地学校的网页工作(就在学校开学之前)。他们外面雇佣的公司真的搞砸了。我试图让他们的计算机启动并运行并获得他们的应用程序给他们。 有这个代码翻过来世界历史课的图像。我已经从页面中删除了代码,但页面仍然无法正常运行。 我是一个非常新的JS,虽然我明白我在看什么,但我不 有人可以帮我吗? 韦德 08122005 1505 GMT-5 Hello. I am working on a webpage for the local school (just before school starts). Their outside hired company really screwed things up. Im trying to get their computers up and running and gain access to their apps for them. There is this code that flips through images for World History class. I have removed the code from the page but the page still does not function. Im so very new to JS that while I understand what Im viewing, I do not understand why it doesnt work. Could somebody help me on this? Wade [ snip] 让我们简化它 - 很多! < HTML> < ; HEAD> < TITLE> CountDown< / TITLE> < script type =" text / JavaScript"> var pic = [ " 1.jpg", " 2.jpg", " 3.jpg" " 4.jpg" ]; var pix = 0; var sec = 2; 功能图片(){ document.roll.src = pic [pix]; window.setTimeout(" pictures()",1000 *秒); (pix< pic.length-1)? pix ++:pix = 0; } < / script> < / HEAD> < ; BODY onLoad =" pictures()"> < img src =" 1.jpg"名称= QUOT;辊"边界=" 0" alt =""> < / BODY> < / HTML>[snip]Let''s simplify it -- a lot!<HTML><HEAD><TITLE>CountDown</TITLE><script type="text/JavaScript">var pic = ["1.jpg","2.jpg","3.jpg""4.jpg"];var pix = 0;var sec = 2;function pictures() {document.roll.src = pic[pix];window.setTimeout("pictures()",1000*sec);(pix < pic.length-1) ? pix++ : pix=0;}</script></HEAD><BODY onLoad="pictures()"><img src="1.jpg" name="roll" border="0" alt=""></BODY></HTML>韦德写道: 08122005 1505 GMT-5 有人可以帮我这个吗? 08122005 1505 GMT-5 Could somebody help me on this? < HTML> < HEAD> < TITLE> CountDown< / TITLE> < script language =" JavaScript" type =" text / javascript"> <! - 隐藏其他浏览器 //图片之间切换 if(document.images){ Rollpic1 = new Image(); Rollpic1.src =" my_folder / my_photo_1.jpg" Rollpic2 = new Image(); Rollpic2.src =" my_folder / my_photo_2.jpg" Rollpic3 = new Image(); Rollpic3.src =" my_folder / my_photo_3.jpg" Rollpic4 = new Image(); Rollpic4.src =" my_folder / my_photo_4.jpg" } //图片数量: var NumberOfPictures = 4; //显示图片的计数器 //起始于: var Pictures = 1; //以秒为单位的图片切换之间的时间:HowLongBetweenPics //在SwichPic函数的参数中给出 // - ----- SwitchPic函数------- 函数SwitchPic(HowLongBetweenPics){ if(Pictures< NumberOfPictures){ //如果它不是最后一张图片转到下一张图片 图片++; } else { //如果是最后一张图片转到第一张图片 图片= 1; } / / DEBUG位于屏幕底部的状态栏中 window.status ="切换图片位于+ + HowLongBetweenPics + " :Rollpic" + Pictures +" .src PicNumber:" + Pictures; //在什么< IMG>中显示图片标签名为''roll'' document.images [''roll'']。src = eval(" Rollpic" + Pictures +''。src''); //函数调用自身 CallSwitchPic = setTimeout(" SwitchPic()",HowLongBetw eenPics * 1000); } //停止隐藏旧浏览器 - > < / script> < / HEAD> < ; BODY onLoad =" SwitchPic(5)" < img src =" my_folder / my_photo_1.jpg"边界=" 0" name =" roll"> < / BODY> < / HTML> - Stephane Moriaux et son [moins] vieux Mac<HTML><HEAD><TITLE>CountDown</TITLE><script language="JavaScript" type="text/javascript"><!-- hide from other browsers//Pictures to switch inbetweenif(document.images) {Rollpic1 = new Image(); Rollpic1.src = "my_folder/my_photo_1.jpg"Rollpic2 = new Image(); Rollpic2.src = "my_folder/my_photo_2.jpg"Rollpic3 = new Image(); Rollpic3.src = "my_folder/my_photo_3.jpg"Rollpic4 = new Image(); Rollpic4.src = "my_folder/my_photo_4.jpg"}//Number of pics:var NumberOfPictures = 4;// Counter of displayed Pictures// starts at :var Pictures = 1;// Time between pics switching in secs : HowLongBetweenPics// is given in argument of SwichPic function// ------ SwitchPic Function -------function SwitchPic(HowLongBetweenPics){if(Pictures < NumberOfPictures){//if it''s not the last picture goto the next picturePictures++;}else{// if it was the last picture goto the 1st picturePictures = 1;}//DEBUG in the status bar at the bottom of the screenwindow.status="Switch picture at "+HowLongBetweenPics+" : Rollpic"+Pictures+".src PicNumber : "+Pictures;//Display pic in what <IMG> tag named ''roll''document.images[''roll''].src = eval("Rollpic"+Pictures+''.src'');//function calls itselfCallSwitchPic=setTimeout("SwitchPic()",HowLongBetw eenPics*1000);}// Stop hiding from old browsers --></script></HEAD><BODY onLoad="SwitchPic(5)"><img src="my_folder/my_photo_1.jpg" border="0" name="roll"></BODY></HTML>--Stephane Moriaux et son [moins] vieux Mac McKirahan写道:McKirahan wrote:" Wade" < WA ** @ wadesmart.com>在消息中写道新闻:11 ********************** @ g43g2000cwa.googlegr oups.com ...... "Wade" <wa**@wadesmart.com> wrote in message news:11**********************@g43g2000cwa.googlegr oups.com... 08122005 1505 GMT-5 你好。我正在为当地学校的网页工作(就在学校开学之前)。他们外面雇佣的公司真的搞砸了。我试图让他们的计算机启动并运行并获得他们的应用程序给他们。 有这个代码翻过来世界历史课的图像。我已经从页面中删除了代码,但页面仍然无法正常运行。 我是一个非常新的JS,虽然我明白我在看什么,但我不 有人可以帮我吗? 韦德 [snip] 让我们简化它 - 很多! < HTML> < HEAD> < TITLE> CountDown< / TITLE> < script type =" text / JavaScript"> var pic = [" 1.jpg"," 2.jpg"," 3 .jpg" " 4.jpg" ]; var pix = 0; var sec = 2; 功能图片(){ document.roll.src = pic [pix];08122005 1505 GMT-5Hello. I am working on a webpage for the local school (just beforeschool starts). Their outside hired company really screwed things up.Im trying to get their computers up and running and gain access totheir apps for them.There is this code that flips through images for World History class. Ihave removed the code from the page but the page still does notfunction.Im so very new to JS that while I understand what Im viewing, I do notunderstand why it doesnt work.Could somebody help me on this?Wade [snip] Let''s simplify it -- a lot! <HTML> <HEAD> <TITLE>CountDown</TITLE> <script type="text/JavaScript"> var pic = [ "1.jpg", "2.jpg", "3.jpg" "4.jpg" ]; var pix = 0; var sec = 2; function pictures() { document.roll.src = pic[pix]; 只适用于IE window.setTimeout(" pictures() ,1000 * sec); (pix< pic.length-1)? pix ++:pix = 0; } < / script> < / HEAD> < BODY onLoad =" pictures()"> < img src =" 1.jpg"名称= QUOT;辊"边界=" 0" alt =""> < / BODY> < / HTML>that will only work with IE window.setTimeout("pictures()",1000*sec); (pix < pic.length-1) ? pix++ : pix=0; } </script> </HEAD> <BODY onLoad="pictures()"> <img src="1.jpg" name="roll" border="0" alt=""> </BODY> </HTML> - Stephane Moriaux et son [moins] vieux Mac--Stephane Moriaux et son [moins] vieux Mac 这篇关于改变图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-23 16:57