I've seen so many plugins to discolor an image using a tag .
But I did not find anything to discolor the background image (An image that is used as the background for an element (div).
Is there a way to discolor the background image when hovering using 2 backgrounds (Ie Image sprites are B & W, and Other is color)
I can do something like this using Image Sprites.
// Initially color Image $(<element>).mouseover(function(e){ jQuery(this).children(":first").stop().animate( { 'background-position': <some coordinates> // Coordinates of b&w Image }, 100 ); e.stopPropagation(); }) .mouseout(function(e){ jQuery(this).children(":first").stop().animate( { 'background-position': <some coordinates> // Coordinates of color Image }, 100, settings.easingType ); e.stopPropagation(); });
But I do not want this. I want to bleach the background image on the fly. Please help.
Mkaka source share