Mouse Over with Image Map possible?

Results 1 to 2 of 2

Thread: Mouse Over with Image Map possible?

  1. #1
    Join Date
    Dec 1969

    Default Mouse Over with Image Map possible?

    Hi, I am working on a page that has an image of a motorcycle and another image of a rectangle (a type of LCD Display). I need the images in the rectangle to change as the mouse rolls over certain sections of the motorcycle. Please visit this page to see what I need done: Please provide the actual code since I do not know any Java at all. I had someone try and give me code for this but it did not work....can you make it work? Possible future contract work for the person who can.

  2. #2
    Join Date
    Dec 1969

    Default RE: Mouse Over with Image Map possible?

    kirk,<BR>find below a code snippet that should do what you want. This works in netscape and IE. You need to be sure to preload all the images you will be using in the rollovers.<BR><BR>&#060;script language="javascript"&#062;<BR> var netscape = 0;<BR> var goodIE = 0;<BR> browserName = navigator.appName.substring(0,8);<BR> browserVer = parseFloat(navigator.appVersion);<BR> if (browserName == "Netscape" && browserVer &#062;= 3)<BR> { netscape = 1; }<BR> if (browserName == "Microsof" && browserVer &#062;= 4)<BR> { goodIE = 1; }<BR><BR> if (netscape &#124&#124 goodIE) {<BR> //Preload all images here using construct below<BR> //imageObjName = new Image(width, height)<BR> //imageObjName = image src url<BR> //eg<BR> welcome = new Image(63,400);<BR> welcome.src = "images/welcome.gif";<BR> <BR> }<BR><BR>function swapImage(imgDocID, imgObjName) {<BR>if (netscape &#124&#124 goodIE) {<BR> document.images[imgDocID].src = eval(imgObjName + ".src");<BR>}}<BR>&#060;/script&#062;<BR><BR>to use the script, in the appropriate imagemap area:<BR>onmouseOver="swapImage(idOfGreenBox, imageToSwitchToObjectName)" onmouseout="swapImage(idOfGreenBox, defaultImageObjectName)"<BR><BR>hope that this helps.<BR><BR>Dave.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts