Shadow Wolf Posted July 19, 2007 Share Posted July 19, 2007 Is it possible with just CSS to randomize or have the background cycle through a set of pre-selected background images? Link to comment https://forums.phpfreaks.com/topic/60798-randomize-background-image/ Share on other sites More sharing options...
jvrothjr Posted July 19, 2007 Share Posted July 19, 2007 You want to do it on load or as ther user is sitting at the page? Link to comment https://forums.phpfreaks.com/topic/60798-randomize-background-image/#findComment-302501 Share on other sites More sharing options...
calabiyau Posted July 19, 2007 Share Posted July 19, 2007 No you can't do that with just css...on load you could use php to pick a random background...while user is sitting there to cycle through, I would think javascript could do that. Link to comment https://forums.phpfreaks.com/topic/60798-randomize-background-image/#findComment-302888 Share on other sites More sharing options...
Shadow Wolf Posted September 14, 2007 Author Share Posted September 14, 2007 It would be with onload, not as the user is sitting there. Just when they load or refresh the page the background would random. Sort of like randomizing a banner/header but wanting that to remain static while the background changes so the banner/header is always the top layer. Link to comment https://forums.phpfreaks.com/topic/60798-randomize-background-image/#findComment-348394 Share on other sites More sharing options...
ToonMariner Posted September 14, 2007 Share Posted September 14, 2007 can't do it in css - use php to set an inline style attribute like so <.... style="background-image: url(/path/to/background/image)" ....> set the rest of the background styles in your css file. Link to comment https://forums.phpfreaks.com/topic/60798-randomize-background-image/#findComment-348402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.