Как мне добавить появление? - PullRequest
1 голос
/ 01 декабря 2010

Как бы я добавил это?

  $(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]);      

});

Ответы [ 4 ]

3 голосов
/ 01 декабря 2010

Вы можете просто связать .hide() с .fadeIn(), например:

$('#quoteHome').html(myQuotes[myRandom]).hide().fadeIn();
1 голос
/ 01 декабря 2010

Используйте этот метод:

$('#quoteHome').hide().html(myQuotes[myRandom]).fadeIn('fast');
0 голосов
/ 01 декабря 2010

не может быть проще.

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

Просто убедитесь, что для #quoteHome установлено значение display:none из getgo.

0 голосов
/ 01 декабря 2010
 $('#quoteHome').fadeIn();

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

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