I want to add the function of changing the font-size in my vector-template. I found a simple code snippet on this site:
http://www.centerkey.com/style/switcher/. I pasted the following code fragments in my template:
Inside the header (at the last line):
<script type="text/javascript">
var StyleFile = "style" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" media="screen" type="text/css" href="user/' + StyleFile + '">');
</script>
Inside the body:
<a href="javascript: document.cookie='style='; window.location.reload();">standard</a> |
<a href="javascript: document.cookie='style=2'; window.location.reload();">large</a> |
<a href="javascript: document.cookie='style=3'; window.location.reload();">huge</a>
I created the files "style.css", "style2.css" and "style3.css" in lib/tpl/vector/user with the content
body { font-size: 100%; }
in style.css
body { font-size: 130%; }
in style2.css and
body { font-size: 150%; }
in style3.css
But this didn't work.
The cookie is existing after clicking on one of the links.
Then I found the possibility to put the javascript-code from the header in the file /user/user.js, so I did this and activated the function "tpl»vector»vector_loaduserjs" in the config menu. This also didn't work.
Has anybody a clue what I'm doing wrong?
Thanks and please excuse my bad English... ;-)