...

View Full Version : Can anyone help me fix my code?



Jedi6391
09-04-2011, 10:56 PM
My code used to work but suddenly stopped working and I have no idea why. It is javascript embedded in an html document.



<script language="JavaScript1.1">

var slideimages = new Array()
var slidelinks = new Array()
function slideshowimages() {
for (i = 0; i < slideshowimages.arguments.length; i++) {
slideimages[i] = new Image()
slideimages[i].src = slideshowimages.arguments[i]
}
}

function slideshowlinks() {
for (i = 0; i < slideshowlinks.arguments.length; i++)
slidelinks[i] = slideshowlinks.arguments[i]
}

function gotoshow() {
if (!window.winslide || winslide.closed)
winslide = window.open(slidelinks[whichlink])
else
winslide.location = slidelinks[whichlink]
winslide.focus()
}

</script>

From body:

<a href="javascript:gotoshow()"><img class="dropshadow"src="images/slideshow_1.gif" name="slide" border=0 width=240 height=180></a>

<script>

//configure the paths of the images, plus corresponding target links
slideshowimages("images/slideshow_1.gif", "images/slideshow_2.gif", "images/slideshow_3.gif", "images/slideshow_4.gif", "images/slideshow_5.gif")

//configure the speed of the slideshow, in miliseconds
var slideshowspeed = 3000

var whichlink = 0
var whichimage = 0
function slideit() {
if (!document.images);
return document.images.slide.src = slideimages[whichimage].src whichlink = whichimage
if (whichimage < slideimages.length - 1);
whichimage++else
whichimage = 0 setTimeout("slideit()", slideshowspeed);
}
slideit()

</script>



Any help would be greatly appreciated.

Logic Ali
09-04-2011, 11:57 PM
if (!document.images);
return document.images.slide.src = slideimages[whichimage].src whichlink = whichimage
if (whichimage < slideimages.length - 1);The most obvious problem is the semicolons after the if clauses, which should not be there.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum