hello everybody,
i don't like javascript and usually try to avoid it... but now i need it and am having some troubles with it, so i hope someone can help me find out a nice solution.
I am using some simple functions to create a slideshow. These functions' code is in an external .js file which is called in my pages using:
Code:
<script type="text/javascript" src="fileLocation.js">
before closing the script tag i initialize my variables:
Code:
// Use the following variable to specify
// the number of images
var imgNumber = 0;
var NumberOfImages = 3;
var img = new Array(NumberOfImages);
// Use the following variables to specify the image names:
img[0] = "1.jpg";
img[1] = "2.jpg";
img[2] = "3.jpg";
i then call the functions through two links:
Code:
<a href="#" onclick="imgNumber=previm(imgNumber, NumberOfImages, img);return false;">
<img src="../../../immagini/prev.png" class="arrows" alt="" /></a>
<a href="#" onclick="imgNumber=nextim(imgNumber, NumberOfImages, img);return false;">
<img src="../../../immagini/next.png" class="arrows" alt="" /></a>
everything works on firefox, opera, konqueror, safari... but on Explorer 6 i got an error: imgNumber is undefined...
the only solution i found is to copy and paste the functions' code on every page. Of course i would like to avoid this for maintenance... and can't really understand why it doesn't work.
thanks a lot...