Cyrill
Cyrill

Reputation: 833

Need to set a short timeout in JS … How To?

This is my JS Code:

   $('#archive').click(function(){

    $("#intro-page").slideUp(250);
$('#dapper').show();
$('#navigation').show();
$('.picture_holder_thumb').each(function(index) {
$(this).delay(50*index).fadeIn(400);
});

And I want to set a short timeout after the sliding up… The Intro-Page slides up, the wrapper (dapper) will be shown and then – Timeout – the .picture_holder_thumb fades in… How to I write this?

Upvotes: 0

Views: 289

Answers (1)

imjared
imjared

Reputation: 20554

jQuery's .slideUp() method has a callback available when the animation completes.

.slideUp([duration] [, complete])

So,

$('#archive').click(function() {
    $("#intro-page").slideUp(250, function() {
        $('#navigation').show();
        $('.picture_holder_thumb').each(function(index) {
            $(this).delay(50 * index).fadeIn(400);
        });
    });
    $('#dapper').show();
});

http://jqapi.com/#p=slideUp

Upvotes: 1

Related Questions