2013-08-16 22 views
0

當我的頁面加載,我會使用jQuery加載「阿爾法」,然後再幾秒鐘後「.omega」。那裏有沒有例子?我會用easeIn,淡入,淡出或?如何使兩類標籤緩解單獨頁面加載時

謝謝。

怎麼會加上 「.omega」 這樣做呢?

jQuery(document).ready(function() { 


jQuery(window).load(function() { 
    setTimeout(function() { 
     $(".alpha").fadeOut("fast", function() {}) 
    }, 500) 
}) 


}); 

回答

0

我會用setTimeout和使用fadeIn

//you probably do not need to use setTimeout for .alpha, but just in case... 
setTimeout(function() { 
    $('.alpha').fadeIn(); 
}, 100); 

//then load .omega 2 seconds after .alpha... 
setTimeout(function() { 
    $('.omega').fadeIn(); 
}, 2100); 

更新回答您的例子:在發

jQuery(document).ready(function() { 
    jQuery(window).load(function() { 
      //load in .alpha 
     setTimeout(function() { 
      $(".alpha").fadeIn("fast", function() { 
       //alpha finished loading 
       //now load omega 
       setTimeout(function() { 
        $(".omega").fadeIn("fast", function() { 
         //omega finished loading 
        }) 
       }, 2000); 
      }); 
     }, 500); 
    }); 
}); 
0
$(this).delay(2000).animate({ 
        'margin-top':'60%', 
        'opacity':0},2000,function(){ 

         $(this).remove(); 
         if(nr==1){ 
          showIntro(2); 
         }else if(nr==2){ 
          $('.wrapper').fadeIn(2000); 
         } 
       }); 

JSFIDDLE DEMO

0

使用回調宣德()函數:

$('.first').fadeIn(function(){ 
    $('.second').fadeIn() 
}) 

看小提琴:http://jsfiddle.net/WPw25/

如果你想有一個延遲使用延遲()函數:

$('.first').fadeIn(function(){ 
    $('.second').delay(3000).fadeIn() 
}) 

小提琴:http://jsfiddle.net/WPw25/1/

0

你可以使用

$(".alpha").fadeIn(1000); 
    $(".omega")delay(1000).fadeIn(); 
相關問題