Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is it possible to have rotating background image


filmcell

Recommended Posts

Posted

i have a movie related store website , and i think it would be cool to have the backround image rotating everytime the page was refreshed or changed to a new page . It there a way to do this. Or would it just be a fixed one background image.

thanks.

Posted

Well, if instead of having a fixed background-image for the "body" tag in CSS, you could do a couple of things:

 

1) In the PHP code that generates a page, output <body style="background-image: url('<?php rotating_bg_img(); ?>');" other attributes> (or something similar). You supply the new function somewhere that returns a path and image name to use, and have a library of images somewhere.

 

2) Similar to (1), but in Javascript to update "onload" the body element .style.backgroundImage to point to a file on your server. This can be enhanced to make a dynamic slide show, but that's bandwidth-intensive and distracting, so use it with restraint if you use it at all.

 

In either case, you'll probably have to drop your new code into every customer-facing PHP file, rather than just one convenient central place :'( .

 

Have you checked this forum for earlier discussion on this, and the add-ons to see if it's been implemented? I think I recall this subject coming up many times before.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...