I’m looking to have a full page image with a section of the image that, when hovered over, changes the image to a colored version of the original black & white image. I tried doing this with image maps & onMouseOver, but didn’t have any success. There are only two images being used, a color and a black and white one.
I just want to have it so that when you hover over a section of the black and white image, the whole thing turns to the color version, and onMouseOut reverts back to the black and white. I’m using this as a splash screen for a blog and the hovered section will serve as a link into the site.
Thanks for the help
If you don’t mind your hover area being “square” then using pure css this should work (note, replace the background colors with your appropriate image and the
borderon theais just for illustration). Tested in Firefox, IE7, IE8:HTML:
CSS (EDITED FOR IE7-8 BUGS):
Of course if IE6 is a concern, then you need to do something with javascript for it to recognize the
span:hover.ADDED ON EDIT: I discovered that the
atag would hover sometimes outside of the defined area for the IE browsers. To avoid that, the body must have margins placed on such that theleftandtopposition theatag, and therightandbottommust make up the difference in the image size minus the total width of theatag.