Skip to content

Instantly share code, notes, and snippets.

@riix
Created July 30, 2012 06:13
Show Gist options
  • Save riix/3205255 to your computer and use it in GitHub Desktop.
Save riix/3205255 to your computer and use it in GitHub Desktop.
Simple Style Switcher
$(document).ready(function(){
$('#styleSwitch .button').bind('click', function(){
$('body').removeClass();//remove all the other classes
$('#styleSwitch .button').removeClass('selected');
$(this).addClass('selected');
switch(this.id){
case 'style1':
$('body').addClass('style1');
break;
case 'style2':
$('body').addClass('style2');
break;
case 'style3':
$('body').addClass('style3');
break;
}
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment