|
-
Dec 25th, 2001, 07:59 PM
#1
Thread Starter
Frenzied Member
Javascript help
How do you make a picture change when the mouseover event occurs?
-
Dec 25th, 2001, 08:18 PM
#2
Member
Code:
<a href="someplace.html"
onMouseOver="document.images['myimage'].src='hot.gif'"
onMouseOut="document.images['myimage'].src='cold.gif'"
><img name="myimage" src="cold.gif"></a>
-
Dec 26th, 2001, 02:46 AM
#3
PowerPoster
A better way is to create an array of images, in a function or not, (so long as it is created at runtime) and use a function to swap the image from this array. This guarantees (virtually) that the images will all load before you try a mouseOver event, so the effect is faster and smoother.
Go to http://www.endeavour.net.au/index2.html and take a look at the code in the left menu frame. That is a working one, I can't be stuffed duplicating it now...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Dec 28th, 2001, 05:23 AM
#4
Lively Member
Try This!!!
Get a two Layer place a diffrent picture in it ..
then in set a behaviour that on mouse over show one image and on mouse out second image...
sandin
-
Dec 28th, 2001, 11:40 PM
#5
PowerPoster
What do you mean by two layer? I'm not familiar with that one. IS it as *searching for appropriate word* usable(??) as JavaScript image.src swaps? That is, will as many browsers recognise it?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|