Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing CSS sheets dynamically and cooki'ing them 1

Status
Not open for further replies.

louisgnarf

Programmer
Jul 11, 2002
14
US
Well, the basic idea is at codelifter.com:


I would like to modify this so that it can make a cookie that will remember the chosen CSS sheet for all future visits, but I don't know how to do that in JavaScript...I've seen other examples of code that does it, but I sort of like codelifter's version because all the scriptcode is in the <head> tags (as opposed to the body of the document). Is there anyway to easily modify this code to let it support cookies?
 
Here's how to make cookies:
If it were I, I'd make a function that makes the cookie and call it like this:
<a href=&quot;JavaScript:changeSheets(1);cookie(1)&quot;>Style One</a>

and the function cookie() would say to write what's in the &quot;()&quot; this time 1, as the desired stylesheet.

Rick If I have helped you just click the first link below to let me know :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top