Yellow fade effect with JQuery

前端 未结 15 1719
萌比男神i
萌比男神i 2020-11-29 16:23

I would like to implement something similar to 37Signals\'s Yellow Fade effect.

I am using Jquery 1.3.2

The code

(function($) {
   $.fn.yell         


        
15条回答
  •  抹茶落季
    2020-11-29 17:11

    Define your CSS as follows:

    @-webkit-keyframes yellowfade {
        from { background: yellow; }
        to { background: transparent; }
    }
    
    @-moz-keyframes yellowfade {
        from { background: yellow; }
        to { background: transparent; }
    }
    
    .yft {
        -webkit-animation: yellowfade 1.5s;
           -moz-animation: yellowfade 1.5s;
                animation: yellowfade 1.5s;
    }
    

    And just add the class yft to any item $('.some-item').addClass('yft')

    Demo: http://jsfiddle.net/Q8KVC/528/

提交回复
热议问题