I’m looking for code to randomize a background image on one section of a single-page scroll website. I have researched ways of doing this (php/js/html stuff; one ex, second ex), but I couldn’t get it them to work because I don’t want the images to apply to all of the pages/sections and I don’t want it in the “body” of the HTML.” Please advise!
Currently, I change the background in the CSS with backgound-image code of a single class.
This is the PHP code for randomizing background images:
And:
This is the JavaScript and JQuery solution for randomizing background images:
See this in action (hit run in top left to randomize the image): http://jsfiddle.net/Kf6sb/