R
richk
For some reason when I add additional buttons a 3rd button and beyond
i cant get the effect to work and I get errors...I cant understand
why...
<SCRIPT LANGUAGE = "javascript"><!--
if (document.images) { // Active Images
img1on = new Image();
img1on.src = "button1_on.jpg";
img2on = new Image();
img2on.src = "button2_on.jpg";
img1off = new Image();
img1off.src = "button1_off.jpg";
img2off = new Image();
img2off.src = "button2_off.jpg"; }
// Function to 'activate' images.
function imgOn(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "on.src");
}
}
// Function to 'deactivate' images.
function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");
}
}
// -->
</SCRIPT>
<A HREF="page1.htm" onMouseOver="imgOn('img1')"
onMouseOut="imgOff('img1')">
<IMG NAME="img1" SRC="button1_off.jpg" ALT="mouseover button"
HEIGHT="30"
WIDTH="147" VSPACE="0" HSPACE="0" BORDER="0"></A>
<A HREF="page2.htm" onMouseOver="imgOn('img2')"
onMouseOut="imgOff('img2')">
<IMG NAME="img2" SRC="button2_off.jpg" ALT="another mouseover button"
HEIGHT="30"
WIDTH="147" VSPACE="0" HSPACE="0" BORDER="0"></A>
i cant get the effect to work and I get errors...I cant understand
why...
<SCRIPT LANGUAGE = "javascript"><!--
if (document.images) { // Active Images
img1on = new Image();
img1on.src = "button1_on.jpg";
img2on = new Image();
img2on.src = "button2_on.jpg";
img1off = new Image();
img1off.src = "button1_off.jpg";
img2off = new Image();
img2off.src = "button2_off.jpg"; }
// Function to 'activate' images.
function imgOn(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "on.src");
}
}
// Function to 'deactivate' images.
function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");
}
}
// -->
</SCRIPT>
<A HREF="page1.htm" onMouseOver="imgOn('img1')"
onMouseOut="imgOff('img1')">
<IMG NAME="img1" SRC="button1_off.jpg" ALT="mouseover button"
HEIGHT="30"
WIDTH="147" VSPACE="0" HSPACE="0" BORDER="0"></A>
<A HREF="page2.htm" onMouseOver="imgOn('img2')"
onMouseOut="imgOff('img2')">
<IMG NAME="img2" SRC="button2_off.jpg" ALT="another mouseover button"
HEIGHT="30"
WIDTH="147" VSPACE="0" HSPACE="0" BORDER="0"></A>