2010-11-30 4 views
1

これにフェードインを追加するにはどうすればよいですか?フェードインを追加するにはどうすればよいですか?

$(document).ready(function(){ 
    var myQuotes = new Array(); 
    myQuotes[0] = "All is connected... "; 
    myQuotes[1] = "The best way"; 
    myQuotes[2] = "Your work is to discover"; 
    myQuotes[2] = "If success"; 

    var myRandom = Math.floor(Math.random()*myQuotes.length); 
    $('#quoteHome').html(myQuotes[myRandom]);  

});

答えて

3

このようにあなたはただ、.fadeIn().hide()をチェーンすることができます

$('#quoteHome').html(myQuotes[myRandom]).hide().fadeIn(); 
0
$('#quoteHome').fadeIn(); 

$('#quoteHome').fadeIn(1000); //duration in milliseconds 

$('#quoteHome').fadeIn('fast'); //speed 
0

は簡単なことではありません。

$('#quoteHome').html(myQuotes[myRandom]).fadeIn('slow'); 

だけ#quoteHomeがgetgoからdisplay:noneに設定されていることを確認してください。

1

このメソッドを使用:

$('#quoteHome').hide().html(myQuotes[myRandom]).fadeIn('fast'); 
関連する問題