FishyMonkey78
12-01-2003, 05:45 PM
To clarify, I want to use something like...
In the head:
homeon = new Image()
homeon.src = "homeon.gif"
homeoff = new Image()
homeoff.src = "homeoff.gif"
Obviously just to preload the images.
In the body:
function MouseOver() {
if (document.images) {
elementName.src = eval(elementName + "off.gif");
}
}
Then in the actual image I'd do
<img name="home" src="homeon.gif" onMouseOver="MouseOver()">
What I'm trying to do is to say on mouse over, check to see if images are supported, then change the source of the image the=at the function is being used in to that image's name assigned to it, plus "off.gif"
So is there a command that points to the name of the imahe the function is being used in, and will that command allow me to do what I'm trying to do?
Also, help me out with the basic script if there is a command. I know what I have right now might not work, so if there is that command, help me out on the whole function script. I'm just trying to do an entire set of mouseover's with one function.
In the head:
homeon = new Image()
homeon.src = "homeon.gif"
homeoff = new Image()
homeoff.src = "homeoff.gif"
Obviously just to preload the images.
In the body:
function MouseOver() {
if (document.images) {
elementName.src = eval(elementName + "off.gif");
}
}
Then in the actual image I'd do
<img name="home" src="homeon.gif" onMouseOver="MouseOver()">
What I'm trying to do is to say on mouse over, check to see if images are supported, then change the source of the image the=at the function is being used in to that image's name assigned to it, plus "off.gif"
So is there a command that points to the name of the imahe the function is being used in, and will that command allow me to do what I'm trying to do?
Also, help me out with the basic script if there is a command. I know what I have right now might not work, so if there is that command, help me out on the whole function script. I'm just trying to do an entire set of mouseover's with one function.