Saturday 24 September 2011

Change Website Color Scheme using a button and not just change the background color! Using PHP or JavaScript!?

I have looked and looked all over online and i cant find out a way to change my websites color scheme. I don't want a slider. What i want is when a user hits a button the color scheme of my website changes. Like the background color will go from black to white , the H1 headings will go to green to red, the normal text will go white to black, and so on a so fourth. Please Help me.



Example: I have a black website theme, when the user hits a red button it will change to a red theme.Change Website Color Scheme using a button and not just change the background color! Using PHP or JavaScript!?You need 2 (or more) CSS pages. Link to your first CSS page:



%26lt;link rel=%26quot;stylesheet%26quot; href=%26quot;CODE.css%26quot; type=%26quot;text/css%26quot; id=%26quot;ss%26quot; /%26gt;



then create your button:



%26lt;input type=%26quot;button%26quot; value=%26quot;TEXT%26quot;

onclick=%26quot;document.getElementById('ss')鈥?= 'OTHERCODE.css'; el = document.getElementById('pageBody');

el.removeAttribute('style');%26quot;%26gt;

%26lt;/form%26gt;



(if the code's not showing up correctly, i uploaded the code to my website)
Change Website Color Scheme using a button and not just change the background color! Using PHP or JavaScript!?
You could have different css files, which you included (server sided) depending on a i.e. number submitted through your button.