Is there a way to convert a grayscale image to color when the page loads?
In my current code, I have set the image to grayscale and then used JQuery to remove the grayscale filter which successfully turns it colored. However, I am not seeing any transition effect.
This is my CSS code:
#mainimg {-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
JQuery Code:
$(window).load(function() {
$('#mainimg')
.css("-webkit-filter", "none")
.css("-moz-filter", "none")
.css("filter", "none")
duration: 10
});
I'm having trouble figuring out what I am doing wrong. Should I be using a different approach or code?