Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   Improve your ranking, submit to directories   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 07-07-2004, 04:14 PM   #1 (permalink)
Contributing Member
 
Shannon's Avatar
 
Join Date: 05-29-04
Location: Victoria, BC, Canada
Posts: 90
iTrader: 0 / 0%
Latest Blog:
None

Shannon is liked by many
Send a message via MSN to Shannon
Javascript cookie to remember css choice?

Hi I have this code in my <head>

[code:1:ff5909d9cc]
<link rel="stylesheet" href="wsd.css" type="text/css" media="screen" title="Normal">
<link rel="alternate stylesheet" href="wsdc.css" type="text/css" media="screen" title="Collapsed">
<script type="text/javascript">
function f_SelectStyleSheet (sTitle) {
if (document.getElementsByTagName) {
var asLinks = document.getElementsByTagName("link");
for (var i = 0; i < asLinks.length; i++)
asLinks[i].disabled = !(asLinks[i].title==sTitle);
}
}
</script>[/code:1:ff5909d9cc]

and links in the page which change the stylesheet.

[code:1:ff5909d9cc]
<a href="javascript:f_SelectStyleSheet('Normal');">No rmal</a>
<a href="javascript:f_SelectStyleSheet('Collapsed');" >Slim</a>[/code:1:ff5909d9cc]

What I don't know is how to write a cookie so that the browser 'remembers' the users css choice on refresh or page change.

If anyone wouldn't mind adding to the above code and filling in the blanks to help this occurs I'd be very happy

Thanks much.

ps. I'm not good with JS yet so please include all relevant info. thanks.
__________________
Fendi inspired handbags, and other designer inspired handbags like Prada, Marc Jacobs, Kooba, Chloe at SunnyStyles.com | benjarong
Shannon is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 07-07-2004, 04:43 PM   #2 (permalink)
v7n Mentor
 
imaginemn's Avatar
 
Join Date: 02-18-04
Location: Minneapolis, Minnesota
Posts: 1,941
iTrader: 0 / 0%
Latest Blog:
None

imaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to allimaginemn is a name known to all
Send a message via MSN to imaginemn Send a message via Yahoo to imaginemn Send a message via Skype™ to imaginemn
Are you using PHP, ASP? It makes a difference in the cookie code.

imaginemn
__________________
Imagine Creative Services
Design : Marketing : Multimedia : More
imaginemn is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2004, 07:12 PM   #3 (permalink)
Contributing Member
 
Shannon's Avatar
 
Join Date: 05-29-04
Location: Victoria, BC, Canada
Posts: 90
iTrader: 0 / 0%
Latest Blog:
None

Shannon is liked by many
Send a message via MSN to Shannon
I thought javascript was implied but since i'm not sure if it matters, with regards to the above code... php.

thanks
__________________
Fendi inspired handbags, and other designer inspired handbags like Prada, Marc Jacobs, Kooba, Chloe at SunnyStyles.com | benjarong
Shannon is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set cookie to the visitor so pop only gets shown once ? poseidon Coding Forum 1 09-29-2007 06:48 PM
Put a cookie on my introduction stephen's face Coding Forum 7 07-14-2004 11:37 AM
Cookie SN3 Coding Forum 58 12-14-2003 05:49 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:01 PM.
© Copyright 2008 V7 Inc