PDA

View Full Version : modification on simple vision template


radar71
07-06-2007, 10:18 AM
Hi, on my blog I'm using the simple vision template with pixel post 1.6.
I would like to add – like in the simple template – the possibility to change the background color of the page (white. gray, black)
Can you suggest me a way to do it. I have only to work on the css?
thank

dakwegmo
07-06-2007, 12:36 PM
Copy the /scripts/styleswitcher.js from the simple template into your template/scripts/ directory. Then reference the script in your template
<script type="text/javascript" src="templates/simple/scripts/styleswitcher.js"></script>


Add your primary and alternate style sheets just like the simple template. (I added another alternate style sheet below so you can see how to do multiple alternate styles.)

<link rel="stylesheet" type="text/css" href="templates/simple/styles/light.css" title="light" />
<link rel="alternate stylesheet" type="text/css" href="templates/simple/styles/dark.css" title="dark" />
<link rel="alternate stylesheet" type="text/css" href="templates/simple/styles/blue.css" title="blue" />


Then copy the code for the JavaScript events into the body of your template.

<a href="#" onclick="setActiveStyleSheet('light'); return false;">Light</a>
<a href="#" onclick="setActiveStyleSheet('dark'); return false;">Dark</a>
<a href="#" onclick="setActiveStyleSheet('blue'); return false;">Blue</a>


You can add as many styles as you like using this method. Just make sure you give each lined style sheet a name, and reference the same name in the javascript link.