Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background image slideshow with fading effect?

Status
Not open for further replies.

Beat

Technical User
Aug 26, 2001
41
0
0
SE
Hi,
I've used some scripts earlier that randomly loads images and have them fade out and in.

This time I would like to have a background image to do the same, randomly load a background, like a slideshow while the visitor stays on the page, with a fade in and out effect when changing.

Make sense? Possible?

Cheers!
 
You can't change the opacity of a background image - but you could place the image as the background for a DIV (say) and then set the opacity of that DIV in reducing/increasing increments to provide the fade/show effect.

You would need 2 DIVs... one with the current image (DIV1) and one with the next image (DIV2). You would set them both to be absolute positioned one above the other. Start decreasing the opacity of DIV1 whilst increasing the opacity of DIV2 until DIV1 has opacity 0 and DIV2 has opacity 1 (100%). Then load a new image into DIV1 and repeat.

That's how I'd do it. You could probably set the opacity directly on imline images, but I would put them in DIVs so I could add other styles as well.

Hope that is of use to you,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top