jqStyleswitcher implements the alternate stylesheet switching.
works as jQuery plugin.
Prepare link elements in the header for alternate stylesheets.
<link rel="stylesheet" type="text/css" href="style_standard.css" title="standard" /> <link rel="alternate stylesheet" type="text/css" href="style_larger.css" title="larger" /> <link rel="alternate stylesheet" type="text/css" href="style_largest.css" title="largest" />
You can change current active stylesheet by calling following method.
styleswitcher.setActiveCSS(STYLESHEET_TITLE_ATTRIBUTE_VALUE)".
Following code is the example of the stylesheet switcher elements.
Each click will change the active stylesheet.
<ul>
<li><a href="javascript:void(0)" onclick="styleswitcher.setActiveCSS('standard')">standard</a></li>
<li><a href="javascript:void(0)" onclick="styleswitcher.setActiveCSS('larger')">larger</a></li>
<li><a href="javascript:void(0)" onclick="styleswitcher.setActiveCSS('largest')">largest</a></li>
</ul>
Last activated stylesheet will be activated in other pages too because it was saved into the user's PC as cookie.
Please tell me if you found that this script does not work on your browser though I cannnot support old browsers. takazudo@gmail.com
I checked this script with jQuery version1.2.6.
Please tell me if this script doesn't work in newer version of jQuery.
You can use this script for your personal or commercial use if you don't erase the credit in the script.
| date | version | notes |
|---|---|---|
| 2009/1/5 | 1 | first release. |
No question is asked yet.
Please report me if you found some bugs. takazudo@gmail.com
Original idea of this script was by Paul Sowden.
Thank him about this script!