DCJones
DCJones

Reputation: 3451

Display two divs, one after the other and then call another page

I am trying to do the following. I have two divs, on page load display the first div fading in slowly. Display for x amount of time then fade the first div out while fading in the second div.

This is what I have so far:

$(document).ready(function() {
    loopbox();
    function loopbox() {
        $('#page1').fadeIn(1000).delay(9000).fadeOut(1000, function() {
            $('#page2').fadeIn(1000).delay(9000).fadeOut(1000, function() {
                loopbox();
            });
        });
    }
    window.setTimeout(function(){
        window.location.href = "arrive_ad19.php";
    }, 5000);
        
});

What I need it to do is once the second div has displayed for x amount of time call another page.

Upvotes: 0

Views: 37

Answers (1)

Daantje
Daantje

Reputation: 2486

Is this what you want?

 $('#page1').fadeIn(1000).delay(9000).fadeOut(1000, function() {
     $('#page2').fadeIn(1000).delay(9000).fadeOut(1000, function() {
         window.location.href = "arrive_ad19.php";
     });
 });

Upvotes: 1

Related Questions