Hi there!
I wrote down something that make images act like buttons and it work pretty well except for one thing. I can't seem to be able to specify a specific path for images so I'm force to put them in the same place as the htm file. I want to know if it's possible to determine a relative path to the image so I can put them with the rest of my images in the "images" folder. Here are the code :
<!--
var Pic = new Array
Pic[0] = 'next.jpg'
Pic[1] = 'next-over.jpg'
Pic[2] = 'next-onclick.jpg'
// list continue here...
var p = Pic.length
var preLoad = new Array()
var i = 0;
for (i = 0; i < p; i++)
{
preLoad = new Image()
preLoad.src = Pic
}
function switchImage(whichImage,imageNumber)
{
document.images[whichImage].src = preLoad[imageNumber].src
}
//-->
I tried a few things but it didn't work. If you got it, please let me know. ¦>
I wrote down something that make images act like buttons and it work pretty well except for one thing. I can't seem to be able to specify a specific path for images so I'm force to put them in the same place as the htm file. I want to know if it's possible to determine a relative path to the image so I can put them with the rest of my images in the "images" folder. Here are the code :
<!--
var Pic = new Array
Pic[0] = 'next.jpg'
Pic[1] = 'next-over.jpg'
Pic[2] = 'next-onclick.jpg'
// list continue here...
var p = Pic.length
var preLoad = new Array()
var i = 0;
for (i = 0; i < p; i++)
{
preLoad = new Image()
preLoad.src = Pic
}
function switchImage(whichImage,imageNumber)
{
document.images[whichImage].src = preLoad[imageNumber].src
}
//-->
I tried a few things but it didn't work. If you got it, please let me know. ¦>