Creativebits.org

an All Creative World site
aristrauch's picture
6 pencils

Javascript Question

Hi everyone. First time writer.

I have a javascript coding question that I was hoping someone could help me with and that I am absolutely desperate for an answer for.

I have a two images, image1.gif and image2.gif. When you roll over image1.gif it becomes newimage1.gif and image2.gif becomes newimage2.gif. So you roll over one and both change. No problem there. The only other thing I want to do is to get one of the new images - newimage2.gif - to be an image map.

The code I have now is:

<script language="JavaScript">

if (document.images) {
pic1on = new Image(226, 93);
pic1on.src = "images/newimage1.gif";
pic2on = new Image(684, 296);
pic2on.src = "images/newimage2.gif";
}

function lightup(imgName, imgName2) {
if (document.images) {
imgOn = eval(imgName + "on.src");
document[imgName].src = imgOn;
imgOn2 = eval(imgName2 + "on.src");
document[imgName2].src = imgOn2;
}
}

//-->
</script>




Do you know what I would have to add to the code to make this happen?

If you have any idea and would be able to provide me with the information it would be GREATLY, GREATLY appreciated. Again, I am desperate.

Thank you for listening.

Sincerely,

Ari

Commenting on this Forum topic is closed.

aristrauch's picture
6 pencils

I see my code did not come out on the post. If someone has any information I will explain. Thanks again.

Ari

Creativebits is a blog about creativity, design and Macs. We also have a critique section where you can post your work to get opinions and a forum to discuss any design related topics.

Recommend us on Google

Latest critique

Do you need a great new logo?

If you need a logo for your company or product you can get it done with us.
In our logo store you can pick from over 28,000 pre-made logos that will be customized to your name for free or you can post a contest for us for just $250 and our designers from all over the world will submit dozens of logo design suggestions to your specific needs.

Marketplace