jQuery fadeIn() 不淡入
这个已经被难住了。我正在向元素添加一些 HTML,然后想要将其淡入。但是,在实现时,它不会淡入。它只是立即“捕捉”。语法/顺序看起来正确。任何人都认为我的逻辑有问题:
$('span.mySpan')
// fade out the empty span so it's hidden
.fadeOut('fast',function(){
$(this)
.html($restoreLink) // add the HTML to the hidden span
.fadeIn('slow') // now fade it in
})
This one has be stumped. I'm adding some HTML to a element and then want to fade it in. However, when implemented, it doesn't fade in. It just 'snaps' in immediately. The syntax/order looks right. Anyone see anything wrong with my logic:
$('span.mySpan')
// fade out the empty span so it's hidden
.fadeOut('fast',function(){
$(this)
.html($restoreLink) // add the HTML to the hidden span
.fadeIn('slow') // now fade it in
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它确实有效,这就是我所使用的:
它只是淡入得非常快。将计时器设置为... 5000 毫秒,看看我的意思。
It does work here's what I used:
It just fades in really fast. Set the timer to say... 5000 milliseconds to see what I mean.
您需要在 fadeIn 行末尾和函数末尾添加分号吗? --> ;
Do you need the semicolon at the end of fadeIn line and at the end of the function? --> ;
您使用的是 Internet Explorer 8 吗?我相信 IE8 中 JQuery 的不透明度操作无法正常工作。
Are you using Internet explorer 8? I believe that opacity manipulations with JQuery in IE8 do not work properly.