我如何添加淡入淡出?
$(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]);
});
答案 0 :(得分:3)
答案 1 :(得分:1)
使用此方法:
$('#quoteHome').hide().html(myQuotes[myRandom]).fadeIn('fast');
答案 2 :(得分:0)
$('#quoteHome').fadeIn();
$('#quoteHome').fadeIn(1000); //duration in milliseconds
$('#quoteHome').fadeIn('fast'); //speed
答案 3 :(得分:0)
再简单不过了。
$('#quoteHome').html(myQuotes[myRandom]).fadeIn('slow');
请确保将#quoteHome
设置为来自getgo的display:none
。