Francisc
Francisc

Reputation: 80415

Javascript fade or crossfade background images

Is it possible to fade in / crossfade background images please?

If so, how...

Thank you.

Upvotes: 4

Views: 2859

Answers (4)

lincolnk
lincolnk

Reputation: 11238

I'll hazard a guess and go with 'yes'.

Upvotes: 0

Dooley
Dooley

Reputation: 41

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

Upvotes: 2

mway
mway

Reputation: 4392

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.

Upvotes: 1

Jaime
Jaime

Reputation: 104

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.

Upvotes: 1

Related Questions