CSS3背景图片淡入淡出效果
我想用淡入淡出效果交换背景图像,我尝试了这个:
-webkit-transition: background 300ms ease-in 200ms;
-moz-transition: background 300ms ease-in 200ms;
-o-transition: background 300ms ease-in 200ms;
transition: background 300ms ease-in 200ms;
它滑动而不是淡入淡出。我应该改变什么?
提前致谢
I want to swap background images with the fade effect, I tried this:
-webkit-transition: background 300ms ease-in 200ms;
-moz-transition: background 300ms ease-in 200ms;
-o-transition: background 300ms ease-in 200ms;
transition: background 300ms ease-in 200ms;
and it slides instead of fade. What should I change?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我也在寻找与 CSS3 相关的效果,但没有找到运气!将跟进您的问题。我用 jQuery 解决了这个问题!有很多插件可用。您可以查看此页面。希望对您有帮助。
Well I also looked for this effect to do with CSS3 but find no luck! Will follow up your question. I solve this issue with jQuery! Lots of plugins are available. You can check THIS page. Hope it helps you.
你不能真的,对于一个过渡,你说“如果 property-x 改变,确保它需要 y 秒并使用 z 动画,用 n 延迟”
所以如果你改变背景位置,背景将滑动到该位置。
如果你想让它淡出,你应该使用两个不同的元素并改变两者的不透明度
You can't really, with a transition you say "if property-x changes, make sure it takes y seconds and use z animation, delay it with n"
So if you change the background-position, the background will slide to that position.
if you want it to fade you should use two different element and change the opacity of both