I have a WordPress custom theme that I want to have various alternative background colours based on a dropdown menu. I was going to use alternative stylesheets just to change the background colour of my theme, but it just seems counter-productive. I was also going to use classes to change the background colour, just I’m not too sure which is the best way to go about changing the background colour based on a selected colour.
Example
If I choose “blue” on the dropdown menu that I’ve created, it will change my website’s background to blue. I’ve got all the css in place. I’m now just wondering what the best way would be to go about doing this. I have classes in place for Internet Explorer so I’m not sure how to go about using classes if I do decide to use classes. I guess I could use jQuery?
Sorry for the abrupt question, but I’m not quite sure which would be the most efficient way.
Here’s a way of achieving this in jQuery. You could choose to add a class to the body instead if you like, but remember to remove other classes first.
or via classes: