Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1822 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Alternative stylesheet

Thread title: Alternative stylesheet
Closed Thread    
    Thread tools Search this thread Display Modes  
03-29-2007, 12:50 AM
#1
Steven Fergus is offline Steven Fergus
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 1,212
iTrader: 3 / 100%
 

Steven Fergus is on a distinguished road

  Old  Alternative stylesheet

Hi guys,

I am currently creating a website for a local Visually impairment charity. I have the design all set and it's nicely coded.

I have decided that i am going to create three different stylesheets; standard, high contrast, and one column layout. I have read up a little about alternative stylesheets, and i understand that the 'link rel' needs to be set to alternate stylesheet, and it has to have a title.

My question is:

How could i create a piece of text, or button, that when clicked will load the stylesheet, and that style sheet will stay used until they choose a different stylesheet.

Thanks.

03-29-2007, 06:28 AM
#2
Julian is offline Julian
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
 
Posts: 5,572
iTrader: 0 / 0%
 

Julian is on a distinguished road

  Old

Javascript does this.

03-29-2007, 05:12 PM
#3
Steven Fergus is offline Steven Fergus
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 1,212
iTrader: 3 / 100%
 

Steven Fergus is on a distinguished road

  Old

I had a feeling it was JavaScript. I'll have a look arround to see if i can find the script.

Thanks Julian.

03-29-2007, 07:47 PM
#4
Lee_ is offline Lee_
Status: Member
Join date: Jun 2006
Location: UK
Expertise:
Software:
 
Posts: 184
iTrader: 2 / 100%
 

Lee_ is on a distinguished road

  Old

03-29-2007, 07:58 PM
#5
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Eww, Dynamic Drive make some ugly code, but the idea is there. You can use JavaScript to manipulate the DOM (specifically the link elements) and store the current state in the cookie.

It'd be definitely worth reading "Alternative Style: Working With Alternate Style Sheets" from A List Apart, before resorting to the Dynamic Drive script.

03-29-2007, 08:15 PM
#6
Steven Fergus is offline Steven Fergus
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 1,212
iTrader: 3 / 100%
 

Steven Fergus is on a distinguished road

  Old

Originally Posted by Salathe View Post
Eww, Dynamic Drive make some ugly code, but the idea is there. You can use JavaScript to manipulate the DOM (specifically the link elements) and store the current state in the cookie.

It'd be definitely worth reading "Alternative Style: Working With Alternate Style Sheets" from A List Apart, before resorting to the Dynamic Drive script.
Yes i have read that article - thanks for the help guys. I will put it into practice soon and let you know how i get on.

Thanks.

03-29-2007, 08:26 PM
#7
Amross is offline Amross
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 311
iTrader: 4 / 100%
 

Amross is on a distinguished road

  Old

If you're worried about compatibility (I'm not sure the details about your target audience) this can also be done quite simply by using a server side language such as PHP.

03-29-2007, 08:51 PM
#8
Steven Fergus is offline Steven Fergus
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 1,212
iTrader: 3 / 100%
 

Steven Fergus is on a distinguished road

  Old

Originally Posted by Amross View Post
If you're worried about compatibility (I'm not sure the details about your target audience) this can also be done quite simply by using a server side language such as PHP.
Could you go into more detail please?

The Audience have sight problems. I will be making a High Contrast style sheet, and a single column style sheet. Just so they can select which way they would like to view the website, depending on how good the audience sight is.

03-29-2007, 10:55 PM
#9
Amross is offline Amross
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 311
iTrader: 4 / 100%
 

Amross is on a distinguished road

  Old

Well depending on your target audience, they may be a group of people which have JavaScript disabled (whether manually or by something such as a firewall) and if that is the case, your style sheet switcher would not function if built using JavaScript instead of a server side language.

However with that said, most people do have JavaScript support, it all depends on how wary you are of compatibility and whether you feel and/or know that your target audience will not have JavaScript support in their browser.

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed