我如何在其中添加淡入淡出效果?

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


});

最佳答案

您可以将.hide().fadeIn()链接在一起,如下所示:

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

08-08 07:13