csDealer
10-06-2006, 06:27 AM
Hi, sorry, but I am a Rookie here. Hopefully a little simple help...
I am using a short js that works great for a style switcher but I need to make the settings permanent with a persistent cookie I believe. The code is short and sweet and fast but will only work until the browser is closed. Here's the script...
<script>
var StyleFile = "style" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="' + StyleFile + '" />');
</script>.
I am actually changing the css properties of 4 different divs on a price list page. ( display:block & display:none) More explination if needed.
Here are the links used to change the styles...
<p><strong><a href="javascript: document.cookie='style='; window.location.reload();">Keystone</a> |
<a href="javascript: document.cookie='style=2'; window.location.reload();">Actual Cost</a> |
<a href="javascript: document.cookie='style=3'; window.location.reload();">2.5x Keystone</a> |
<a href="javascript: document.cookie='style=4'; window.location.reload();">Triple Keystone</a></strong></p>
Any ideas would be greatly appreciated. I am not a web designer, just re-writing my entire site/exe presentation to current standards for my customers.
Thank you in advance,
Brent (csDealer)
I am using a short js that works great for a style switcher but I need to make the settings permanent with a persistent cookie I believe. The code is short and sweet and fast but will only work until the browser is closed. Here's the script...
<script>
var StyleFile = "style" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="' + StyleFile + '" />');
</script>.
I am actually changing the css properties of 4 different divs on a price list page. ( display:block & display:none) More explination if needed.
Here are the links used to change the styles...
<p><strong><a href="javascript: document.cookie='style='; window.location.reload();">Keystone</a> |
<a href="javascript: document.cookie='style=2'; window.location.reload();">Actual Cost</a> |
<a href="javascript: document.cookie='style=3'; window.location.reload();">2.5x Keystone</a> |
<a href="javascript: document.cookie='style=4'; window.location.reload();">Triple Keystone</a></strong></p>
Any ideas would be greatly appreciated. I am not a web designer, just re-writing my entire site/exe presentation to current standards for my customers.
Thank you in advance,
Brent (csDealer)