Javascript 淡入淡出或交叉淡入淡出背景图像
请问可以淡入/交叉淡入淡出背景图像吗?
如果是的话,如何...
谢谢。
Is it possible to fade in / crossfade background images please?
If so, how...
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不。
嵌套一堆对象或使用绝对定位堆叠它们通常是完成任务的唯一方法。
No.
Nesting a bunch of objects, or stacking them with absolute positioning is typically the only way to accomplish the task.
实现这些类型效果的一个好方法是使用 jQuery。
请看一下:
http://api.jquery.com/fadeOut/
http://api.jquery.com/fadeIn/
这些站点提供了一个很好的示例,说明如何执行每个操作,只需将其应用到您的背景图像即可。
我希望这有帮助。
A great way to do these type of effects is with jQuery.
Please take a look at:
http://api.jquery.com/fadeOut/
http://api.jquery.com/fadeIn/
The sites provide a good example of how to do each, simply apply it to your background images.
I hope this helps.
除非您在具有背景图像集的容器(等)上进行操作,否则不会。您可能需要考虑将“交叉淡入淡出单个元素的背景”更改为“更改多个容器的不透明度,每个容器都有自己的背景图像”——这是一种更现实的 JS 方法。
Not unless you're operating on a container (etc) that has a background image set, no. You may want to consider changing "crossfading the background of a single element" to "changing the opacities of more than one container, each of which having their own background image" - that's a more realistic approach with JS.
我会冒险猜测并回答“是”。
I'll hazard a guess and go with 'yes'.