Adam555
10-12-2002, 08:17 AM
Hi, I found this great script on the web for mouse-over slide show, and it works fine, however I have one problem, probably simple, but for me vey big :-(( that I hope someone migh help me to solve. The problem is as follow: in this script, as it is now, all other images are loading distorted if they are not exactly the same width and hight as the first picture.
Can somebode help me and show how to modify the original script so images don't have to be exactly the same size? Please....:-)
Regards, Adam
adammodes@hotmail.com
</script>
<script language="JavaScript1.1">
var myimages=new Array()
var gotolink="#"
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("plane1.gif","plane2.gif","plane3.gif","plane4.gif","plane5.gif")
</script>
<a href="javascript:warp()"><img src="plane0.gif" name="targetimage" border=0></a>
Below onMouseover event handler should be inside the <a> tag of these links, like below:
<a href="b2.htm" onMouseover="changeimage(myimages[0],this.href)">Plane 1</a>
where "0" inside the variable myimages[0] indicates that when the mouse moves over this link,
the rollover image should be substituted with the first image defined in the function
preloadimages() of Step 1. For each link, you'll need to change "0" to another integer, with
the integer representing the position of the image you wish the rollover image to change to,
again, as defined in function preloadimages().
Can somebode help me and show how to modify the original script so images don't have to be exactly the same size? Please....:-)
Regards, Adam
adammodes@hotmail.com
</script>
<script language="JavaScript1.1">
var myimages=new Array()
var gotolink="#"
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("plane1.gif","plane2.gif","plane3.gif","plane4.gif","plane5.gif")
</script>
<a href="javascript:warp()"><img src="plane0.gif" name="targetimage" border=0></a>
Below onMouseover event handler should be inside the <a> tag of these links, like below:
<a href="b2.htm" onMouseover="changeimage(myimages[0],this.href)">Plane 1</a>
where "0" inside the variable myimages[0] indicates that when the mouse moves over this link,
the rollover image should be substituted with the first image defined in the function
preloadimages() of Step 1. For each link, you'll need to change "0" to another integer, with
the integer representing the position of the image you wish the rollover image to change to,
again, as defined in function preloadimages().