Using jQuery to make a group of images appear in order.

Posted by Sean Johnson on Stack Overflow See other posts from Stack Overflow or by Sean Johnson
Published on 2010-05-13T16:47:40Z Indexed on 2010/05/13 17:04 UTC
Read the original article Hit count: 219

Filed under:

I have a page that shows a bunch of thumbnails (around 30), and the client is wanting them to appear one by one, in order, going from left to right on the page. This is what I've tried:

var start_opacity = 500;
$j('.grid-photo').each(function(i) {
    start_opacity = start_opacity + 500;            

    setTimeout(function() {
        $j(i).animate({opacity: 1}, 4000);
    }, start_opacity);  
});

It doesn't seem to know what i is referencing. Any thoughts?

© Stack Overflow or respective owner

Related posts about jQuery