|
|
|
|
Thread title: Alternative stylesheet |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
03-29-2007, 12:50 AM
|
#1
|
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
Posts: 1,212
|
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
|
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
Posts: 5,572
|
|
|
03-29-2007, 05:12 PM
|
#3
|
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
Posts: 1,212
|
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
|
Status: Member
Join date: Jun 2006
Location: UK
Expertise:
Software:
Posts: 184
|
|
|
03-29-2007, 07:58 PM
|
#5
|
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
Posts: 3,820
|
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
|
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
Posts: 1,212
|
Originally Posted by Salathe
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
|
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
Posts: 311
|
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
|
Status: Hey, I'm Steven
Join date: Feb 2007
Location:
Expertise:
Software:
Posts: 1,212
|
Originally Posted by Amross
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
|
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
Posts: 311
|
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.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|