Javascript multiple slideshow -
I created an HTML file that uses javascript to display randomly displayed images in 3D tags is. Click on the images to move left or right until I use a slide show in the page, but when I try several slideshows on the same page, it works fine.
Here is the code for a slideshow:
** & lt; Script & gt; Current index = 2; MyImages = New Array (); MyImages [0] = '1images2.jpeg'; MyImages [1] = '1images3.jpeg'; MyImages [2] = '1images4.jpeg'; MyImages [3] = 'artwork.jpg'; MyImages [4] = '1images5.jpeg'; ImagesPreloaded = New array (4) for (var i = 0; i & lt; MyImages.length; i ++) {imagesPreloaded [i] = New image (120,120) uploaded images [i] .src = MyImages [I]} / * We create the task to move forward and return * / function Nexter () {if (current index gt; 0) {--currentindx; Warning ("if in the back"); Document.rightimg.src = document.middleimg.src document. Middleimg.src = document.leftimg.src document.leftimg.src = imagesPreloaded [currentIndx] .src} and {currentIndx = MyImages.length-1 Warning (MyImages.length + "other"); Document.rightimg.src = document.middleimg.src document.middleimg.src = document.leftimg.src document.leftimg.src = imagesPreloaded [currentIndx] .src} writeImageNumber (); } / * ###### ##### * / function setCurrentIndex () {currentIndx = 0; to reload images and text to reload frames; Document.theImage.src = MyImages [0]; Document.form1.text1.value = Message [0]; WriteImageNumber (); } & Lt; / Script & gt; & Lt; Body onload = "setCurrentIndex (); Automatically ()" & gt; & Lt ;! - Start of form for image slideshow ####################### - & gt; & Lt; Div id = "left" style = "float: left" & gt; & Lt; A href = "#" onclick = "back ()" & gt; & Lt; Img src = "1images2.jpeg" width = "265" height = "262" limit = "0" name = "biaumium" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div id = "middle" style = "float: left" & gt; & Lt; A href = "#" onclick = "" & gt; & Lt; Img src = "1images3.jpeg" width = "265" height = "262" limit = "0" name = "medium" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div id = "right" class = "compimg" style = "float: left" & gt; & Lt; A href = "#" onclick = "nexter ()" & gt; & Lt; Img src = "1images4.jpeg" width = "265" height = "262" alt = "limit =" 0 "name =" true "> & Lt; / A & gt; & Lt; / Div & gt; & Lt ;! - End of the form for image slideshow ####################### - & gt; ** Any suggestions ... You are not able to wrap your script into any JavaScript class, so you are all the variables you are using. Global area (page rank) I think if you try to use it many times your variables are written If you post HTML markup, you can get a better answer How are you trying to create multiple slideshows in a single page ...
Comments
Post a Comment