Help - Search - Members - Calendar
Full Version: CSS changing?
Neowin Forums > Help & Discussion Center > Software Discussion & Assistance > Web Browser Discussion
King Antonius
Hows it done? basically im busy creating a website for uni and for future use aswell, basically a portfolio. Im just wondering though, not everybod likes the Style ive got it (red and black and whatnot)

How can i create a link so when clicked it will change the Style Sheet the website is using, so i can include multiple "Skins"

thankyou
raskren
Wrong forum.

http://www.alistapart.com/articles/alternate/
This article is six years old but still relevant today. It outlines a JavaScript based approach for switching stylesheets. Those without scripting turned on won't be able to switch styles.

King Antonius
Quote - (raskren @ Nov 15 2007, 16:23) *
Wrong forum.

http://www.alistapart.com/articles/alternate/
This article is six years old but still relevant today. It outlines a JavaScript based approach for switching stylesheets. Those without scripting turned on won't be able to switch styles.


Sorry my bad, but thanks for the help smile.gif
Primexx
if you want it to be more functional you could do the style switching server side and then use AJAX to dynamically update the page. that way those with JS disabled will still be able to change stylesheets, but just needs a page refresh.
Smitjel
This guy does it with jQuery (javascript on steroids).

http://www.kelvinluck.com/article/switch-s...ets-with-jquery

Check out the demo.

http://www.kelvinluck.com/assets/jquery/styleswitch/
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.