Skip to content

Instantly share code, notes, and snippets.

@shahariaazam
Created September 1, 2013 22:47
Show Gist options
  • Save shahariaazam/6407821 to your computer and use it in GitHub Desktop.
Save shahariaazam/6407821 to your computer and use it in GitHub Desktop.
Stylesheet Switcher
$(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