mbl
09-08-2004, 04:37 AM
Dear and learned friends,
Am two days or so into Javascript but have older programming experience.
Want to have an image be replaced by other ones, depending on the mouse location and have found a good code that does what's wanted except that each selection points to a webpage, and the need is just to display the image and nothing else. In addition, would like the original image to be reset when mouse is no longer on any of the selector text.
This is the code where would like to get rid of the href= "anyPage.htm":
<a href="chris.html" onmouseover="document.pic.src=chris.src">Front View</a><br>
<a href="sam.html" onmouseover="document.pic.src=sam.src">Bottom View</a><br>
<a href="marco.html" onmouseover="document.pic.src=marco.src">Back View</a>
Don't have any chris.html nor sam.html, nor marco.html. Those are from the free web code tutorial.
Want the user to click on "Front View" "Botom View" or "Back View" and show the different views of the item firstly appearing.
The code works fine, except if user presses legend-text, a wepage anchor is gone after. Don't want that, and would like to keep the code as much as possible as is.
Just would like to have the function onmouseover change the image and that's all.
This program, also leaves the last image showing but would like the original image to be reset when mouse is not at selector text.
Have not been able to figure this out for quite a while, nor find clues elsewhere.
Thanks for any reply.
-mbl-
Am two days or so into Javascript but have older programming experience.
Want to have an image be replaced by other ones, depending on the mouse location and have found a good code that does what's wanted except that each selection points to a webpage, and the need is just to display the image and nothing else. In addition, would like the original image to be reset when mouse is no longer on any of the selector text.
This is the code where would like to get rid of the href= "anyPage.htm":
<a href="chris.html" onmouseover="document.pic.src=chris.src">Front View</a><br>
<a href="sam.html" onmouseover="document.pic.src=sam.src">Bottom View</a><br>
<a href="marco.html" onmouseover="document.pic.src=marco.src">Back View</a>
Don't have any chris.html nor sam.html, nor marco.html. Those are from the free web code tutorial.
Want the user to click on "Front View" "Botom View" or "Back View" and show the different views of the item firstly appearing.
The code works fine, except if user presses legend-text, a wepage anchor is gone after. Don't want that, and would like to keep the code as much as possible as is.
Just would like to have the function onmouseover change the image and that's all.
This program, also leaves the last image showing but would like the original image to be reset when mouse is not at selector text.
Have not been able to figure this out for quite a while, nor find clues elsewhere.
Thanks for any reply.
-mbl-