Hi
I have a number of sytle sheets which my visitors can than select through Javascript buttons. This works fine
I would like to then use a cookie to remember the users preference when they change to another page on my site but I just cant get it to work
the code I have which works for changing between style sheets is below, could anyone help with code which will work to remember what a user has selected on the next page?
<link href="style2.css" type="text/css" rel="stylesheet" id="stylesheet" />
<script language="javascript">
<!--
function changeStyle(name){
if(name=='style1')
document.getElementById('stylesheet').href='style1.css';
else if(name=='style2')
document.getElementById('stylesheet').href='style2.css';
else if(name=='style3')
document.getElementById('stylesheet').href='style3.css';}
<td width="22"><input type="button" name="SmallA" class="SmallA" value="A" title="Small Font Size" onclick="changeStyle('style1')"></td>
<td width="24"><input type="button" name="MediumA" class="MediumA" value="A" title="Medium Font Size" onclick="changeStyle('style2')"></td>
<td width="26"><input type="button" name="LargeA" class="largeA" value="A" title="Large Font Size" onclick="changeStyle('style3')"></td>


Reply With Quote
Bookmarks