|
ITA (Programmer) |
5 May 00 8:11 |
I am using a single image with an image map as a navbar. I am trying to change the single image to another image from the hot spot on the page. I am having trouble figuring out the code for a single image. I am familiar with multiple images and changing them, but I am stuck with the single image. below is my code ************************************************************
<MAP NAME="BAR"> <AREA SHAPE=RECT COORDS="(2,110)(42,110)" HREF="link.html" ONMOUSEOVER=active('b1') ONMOUSEOUT=inactive('b1')> <AREA SHAPE=RECT COORDS="(2,111)(42,213)" HREF="LINK2.HTML" > <AREA SHAPE=RECT COORDS="(2,214)(42,325)" HREF="LINK3.HTML" > <AREA SHAPE=RECT COORDS="(2,326)(42,446)" HREF="LINK4.HTML" > <AREA SHAPE=RECT COORDS="(2,447)(42,541)" HREF="LINK5.HTML" > </MAP> <SCRIPT LANGUAGE="JavaScript"> <!--HIDE FROM NON JAVA BROWSERS //THIS IS A FUNCTION THAT WILL CHANGE THE IMAGE OVER THE if (document.images){ b1on = new Image(); b1on.src = "images/b1a.gif"; b2on = new Image(); b2on.src = "images/b2a.gif"; b3on = new Image(); b3on.src = "images/b3a.gif"; b4on = new Image(); b4on.src = "images/b4a.gif"; b5on = new Image(); b5on.src = "images/b5a.gif"; // b1off = new Image(); b1off.src = "images/b.gif"; b2off = new Image(); b2off.src = "images/b.gif"; b3off = new Image(); b3off.src = "images/b.gif"; b4off = new Image(); b4off.src = "images/b.gif"; b5off = new Image(); b5off.src = "images/b.gif"; } //These are the functions that will be called from the mouseover and mouseout function active(imgName){ if (document.images){ imgOn = eval(imgName + "on.src"); document[imgName].src = imgOn; } } function inactive(imgName){ if (document.images){ imgOff = eval(imgName + "off.src"); document[imgName].src = imgOff; } } //STOP HIDING--> </SCRIPT>
<script LANGUAGE=JAVASCRIPT>
<!--
function _CF_checkgetquestion(_CF_this)
{
return true;
}
//-->
</script>
</HEAD> <BODY BGCOLOR="#FFFFFF"> <DIV ALIGN=LEFT> <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> <TR> <TD WIDTH="150"> <IMG VALIGN=BOTTOM SRC="images/sc_logo.gif" > </TD> <TD WIDTH="490"> <IMG SRC="images/b.gif" VALIGN=TOP USEMAP="#BAR" BORDER=0 NAME=b1> </TD> </TR> </TABLE> </DIV> </BODY> </HTML>
|
|