OZONE Asylum
FAQ
How do I change stylesheets dynamically?
This page's ID:
4833
Search
QuickChanges
Forums
FAQ
Archives
Register
You are editing "How do I change stylesheets dynamically?"
Who can edit an FAQ?
Anyone registered may edit an FAQ.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
There a number of ways of doing it and we touch on a number of the answers here: [url=http://www.ozoneasylum.com/Archives/Archive-000003/HTML/20020525-2-001042.html]Changing styles "on the fly"[/url] One simple way is to use this: [code] <script language="Javascript" type="text/javascript"> <!-- function setStyle (stylename) { var lnk = document.getElementsByTagName("LINK")&#91;0&#93;; lnk.href = stylename;} //--> </script> [/code] [internallink=4625]Doc Ozone[/internallink] has worked another one of these techniques up into an excellent example at [internallink=4834]Znippets[/internallink] here: [url=http://www.znippets.com/template/]ZScrollBar demo[/url] Another way is used in this article at AListApart: [url=http://www.alistapart.com/stories/n4switch/]style sheet switcher[/url] ------------------------ Relevant threads: [url=http://www.ozoneasylum.com/Archives/Archive-000003/HTML/20020525-2-001042.html]Changing styles "on the fly"[/url] [url=http://www.ozoneasylum.com/Forum2/HTML/002246.html]Default CSS[/url] ------------------------ Relevant note: As of the time of writing this FAQ was number [b]1[/b] in searches at google for the terms [url=http://www.google.com/search?q=change+stylesheets]change, stylesheets[/url]. __________________ [internallink=4626]Emperor[/internallink] [small][i](Added by: [url=http://www.ozoneasylum.com/cgi-bin/ubbmisc.cgi?action=getbio&UserName=Emperor]Emperor [/url] on Sun 19-May-2002)[/i][/small] [small][i](Edited by: [url=http://www.ozoneasylum.com/cgi-bin/ubbmisc.cgi?action=getbio&UserName=Emperor]Emperor [/url] on Wed 30-Jul-2003)[/i][/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »