Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

incremental css3 fadein

incremental css3 fadein

Problem

How might I do this? I'm trying to use css3 only for performance reasons (fade in can get kind of choppy).

Right now they all happen at the same time.

function fadeInPlaylist(elem) {
    elem.css('opacity',1);
}

$(window).load(function() {
   $('.playlist').each(function(i) {
      setTimeout(fadeInPlaylist($(this)),2500*i);
   });
});        
Problem courtesy of: Tallboy

Solution

You are calling setTimeout incorrectly.

setTimeout(fadeInPlaylist($(this)),2500*i);

should be:

setTimeout(function(){fadeInPlaylist($(this));},2500*i);

Also, here's a working fiddle: http://jsfiddle.net/q7Wa8/

Solution courtesy of: Shmiddty

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

incremental css3 fadein

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×