i building my own website and am just curious about something. when someone clicks on an image(“image1.gif”) i want the image to change into a different image(“image2.gif”) how do i get this function to work properly??
@AdamGundryMar 09.2003 — #Use something like this: [CODE] <body onload="preloadImages()">
<script type="text/javascript"> var i = new Image(); i.src = 'image2.gif'; </script> [/CODE]
This creates a new image object and assigns it at source of image2.gif, so when the browser finishes loading (the onLoad event is called) the image will be preloaded for the change.