Guest User

Untitled

a guest
Oct 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. $(document).ready(function() {
  2. $('#switcher .button').click(function(event) {
  3. $('body').removeClass();
  4.  
  5. if (this.id == 'switcher-narrow') {
  6. $('body').addClass('narrow');
  7. }
  8. else if (this.id == 'switcher-large') {
  9. $('body').addClass('large');
  10. }
  11.  
  12. $('#switcher .button').removeClass('selected');
  13. $(this).addClass('selected');
  14.  
  15. event.stopPropagation();
  16. });
  17. });
  18.  
  19. $(document).ready(function() {
  20. $('#switcher .button').hover(function() {
  21. $(this).addClass('hover');
  22. }, function() {
  23. $(this).removeClass('hover');
  24. });
  25. });
  26.  
  27. $(document).ready(function() {
  28. var toggleStyleSwitcher = function() {
  29. $('#switcher .button').toggleClass('hidden');
  30. };
  31.  
  32. $('#switcher').click(toggleStyleSwitcher);
  33.  
  34. $('#switcher-normal').click(function() {
  35. $('#switcher').click(toggleStyleSwitcher);
  36. });
  37.  
  38. $('#switcher-narrow, #switcher-large').click(function() {
  39. $('#switcher').unbind('click', toggleStyleSwitcher);
  40. });
  41. });
  42.  
  43. $(document).ready(function() {
  44. $('#switcher').click();
  45. });
Add Comment
Please, Sign In to add comment