Created
September 1, 2013 22:47
-
-
Save shahariaazam/6407821 to your computer and use it in GitHub Desktop.
Stylesheet Switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() | |
{ | |
// Call stylesheet init so that all stylesheet changing functions | |
// will work. | |
$.stylesheetInit(); | |
// This code loops through the stylesheets when you click the link with | |
// an ID of "toggler" below. | |
$('#toggler').bind( | |
'click', | |
function(e) | |
{ | |
$.stylesheetToggle(); | |
return false; | |
} | |
); | |
// When one of the styleswitch links is clicked then switch the stylesheet to | |
// the one matching the value of that links rel attribute. | |
$('.styleswitch').bind( | |
'click', | |
function(e) | |
{ | |
$.stylesheetSwitch(this.getAttribute('rel')); | |
return false; | |
} | |
); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment