Golf Store - Debt Consolidation - Web Advertising - Debt Consolidation - Debt Consolidation

PDA

View Full Version : Change html on mouseover?


mattmdesign
Sep 6th 2006, 1:28 pm
Hi,

Does anyone know where I can find the code to do this?

When image1.gif is moused over, change this code that is at the top of the page:

background="http://www.domain.com/bg.gif" style="background-attachment:fixed; background-color:#C1C0C1; background-repeat:repeat-x;"

to this:

background="http://www.domain.com/image1.gif"

Thanks!

ccoonen
Sep 7th 2006, 7:17 pm
setup 2 css classes. one with one img, one with the other, then put an anchor around the "Initializer" image and on the anchor tag put onclick="javascript:document.getElementById("imgToChangeID").className="newClass";

so your not changing the bg image, your changing the class which has a differet bg img associated with it.

mattmdesign
Sep 9th 2006, 1:12 pm
Thanks for the reply, ccoonen. I have a ton of images though (I should've mentioned that), and I don't really want to create a css class for each one. Can anyone think of another way?

Thanks, Matt