开发者

Javascript fade or crossfade background images

Is it possible to fade in / 开发者_开发知识库crossfade background images please?

If so, how...

Thank you.


No. Nesting a bunch of objects, or stacking them with absolute positioning is typically the only way to accomplish the task.


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.


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'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜