Fade Effect on Link Hover?

前端 未结 4 1208
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 04:28

on many sites, such as http://www.clearleft.com, you\'ll notice that when the links are hovered over, they will fade into a different color as opposed to immediately switchi

4条回答
  •  广开言路
    2020-12-02 05:11

    You can do this with JQueryUI:

    $('a').mouseenter(function(){
      $(this).animate({
        color: '#ff0000'
      }, 1000);
    }).mouseout(function(){
      $(this).animate({
        color: '#000000'
      }, 1000);
    });
    

    http://jsfiddle.net/dWCbk/

提交回复
热议问题