如何添加淡入效果?
我该如何添加淡入效果?
$(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]);
});
How would I add a fade in to this?
$(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]);
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以将
.hide()
与.fadeIn()
,如下所示:You can just chain a
.hide()
with a.fadeIn()
, like this:使用这个方法:
Use this method:
再简单不过了。
只需确保从一开始就将
#quoteHome
设置为display:none
。couldn't be easier.
Just make sure that
#quoteHome
is set todisplay:none
from the getgo.