I have an icon that's in black and white, and I want the icon to transition to the color icon (as a crossfade) during the hover event. How can I do thi开发者_开发百科s in jQuery? #stumped.
Thanks!
An example is here : Greyscale Hover Effect w/ CSS & jQuery
How about fading one in and the other out?
$(function(){
$('#coloricon').hide();
$("#bwicon").hover(function(){
$('#bwicon').fadeOut('slow');
$('#coloricon').fadeIn('slow');
});
});
<img id="bwicon" src="bw.png" style="position:absolute;top:50;left:50;">
<img id="coloricon" src="color.png" style="position:absolute;top:50;left:50;">
精彩评论