stylesheet switcher jquery

Stylesheet SwitcherjQuery


<script src="script/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="jquery.cookie.js" type="text/javascript"></script>
    <script type="text/javascript">
        if ($.cookie("css")) {
            $("link").attr("href", $.cookie("css"));
        }
        $(document).ready(function () {
            $("#nav li a").click(function () {
                $("link").attr("href", $(this).attr('rel'));
                $.cookie("css", $(this).attr('rel'), { expires: 365, path: '/' });
                return false;
            });
        });
    </script>
    <ul id="nav">
        <li><a href="#" rel="css/metro.blue.css">Original CSS</a></li>
        <li><a href="#" rel="css/metro.green.css">Larger Text</a></li>
        <li><a href="#" rel="css/metro.red.css">Something Different</a></li>
    </ul>

Download css switcher using jquery


stylesheet switcher jquery stylesheet switcher jquery Reviewed by Bhaumik Patel on 3:30 AM Rating: 5