Fade into black jQuery or Javascript effect? Exists?

user2097217 picture user2097217 · Mar 12, 2013 · Viewed 7.4k times · Source

Does there exist some kind of jQuery fade into black effect withing a specific part of a picture. So it really colors the picture into becoming black? I do know about the canvas element, but it just doesn`t seem like a good solution to me, would be grateful with some help :)

Answer

Nick Andriopoulos picture Nick Andriopoulos · Mar 12, 2013

applying an overlay to the picture ( an absolutely positioned DIV ), and adding opacity: 0 and background-color: black will make a transparent overlay. You can then animate the opacity to 1, basically "darkening" the image progressively.

Edit: here's a fiddle with a demo http://jsfiddle.net/FMSKf/