开发者

Transition From Black and White to Color?

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;">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜