I’m looking for a script of some sort that will select all images on a page within a certain div.class, apply a transparent black shadowing to it, and then fade it out on hover. Does anyone know of a system of doing this? I can’t really modify the site itself (http://cargocollective.com/maureengriswold) or I’d have figured out some shoddy way of doing it already.
Share
Typically you would do this by putting a black background behind your images and the set the opacity of the images to some value < 1.
On your site, you would add the following CSS:
UPDATE:
If you want an animated fading, you would leave out the
:hoverCSS definition and add the following Javascript lines (using jQuery 1.4.2 as already used on your site):Of course you could also native CSS transitions instead for this effect (as suggested in Howard’s answer), but you would need to take care of browser capabilities.