zudolab jqStyleswitcher

About

jqStyleswitcher implements the alternate stylesheet switching.
works as jQuery plugin.

Author

Takeshi Takatsudo [website] [mail]

How to use

Simple usage

  1. Load jQuery, "jqCookie.js" and "jqStyleswitcher.js"
  2. 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" />
  3. 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.

Target browsers

  • Internet Explorer 6+
  • Firefox 2+
  • Safari 2.0.4+
  • Opera 9.6+

Please tell me if you found that this script does not work on your browser though I cannnot support old browsers. takazudo@gmail.com

Depend on

I checked this script with jQuery version1.2.6.
Please tell me if this script doesn't work in newer version of jQuery.

License

You can use this script for your personal or commercial use if you don't erase the credit in the script.

ChangeLog

date version notes
2009/1/5 1 first release.

FAQ

No question is asked yet.
Please report me if you found some bugs. takazudo@gmail.com

Special Thanks

Original idea of this script was by Paul Sowden.
Thank him about this script!