Summary  Summary

Add to your favorites

Maps  Maps
Portal  Portal
Geomatic  Geomatic
Computers  Computers
Download  Download
Jobs  Jobs

Customize  Customize
Games  Games
Forums  Forums
GuestBook  GuestBook

GeoRezo  GeoRezo
Georama  Georama
Web design
Daniel FAIVRE©

JavaScript "Rollover"

  Français Français 
Le JavaScript "Switch"
    One of most used script is certainly the "rollover", e.g. the reaction of an image under the cursor. Many scripts do that: here is probably the simplest one. Furthermore, each object existence is tested. Even if an error occurs, the script should not bug neither display alerts. You can freely copy this source code for your site.
 Le JavaScript "Switch"
    Here's the source code to insert in the <BODY> section of your web page:
/* (c) 2001 freeware - no warranty - ie5 tested - */
function Switch(obj)
   if (obj)
      if (obj.src)
         img = obj.src;
         if (
            obj.src =;
   = img;
   Now, just insert the Switch() function to make an image or a link reactives, like this:
<IMG SRC="image1.png" NAME="image2.png" BORDER=0 onmouseover="Switch(this);" onmouseout="Switch(this);">
   Ce qui donne: , , ou .