1234567891011121314151617181920212223242526272829 |
- $(document).ready(function () {
- 'use strict';
- $('#switcher')
- .hover(
- function () { $(this).addClass('hover'); },
- function () { $(this).removeClass('hover'); })
- .click(function (event) {
- if (event.target === this) {
- $('#switcher button').toggleClass('hidden');
- }
- });
- $('#switcher-default').addClass('selected');
- // Automatic handler names available for (jQuery 1.9.0):
- // blur focus focusin focusout load resize scroll unload click dblclick.
- // mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave
- // change select submit keydown keypress keyup error contextmenu.
- $('#switcher button').click(function () {
- var bodyClass = this.id.split('-')[1];
- $('body').removeClass().addClass(bodyClass);
- $('#switcher button').removeClass('selected');
- $(this).addClass('selected');
- });
- });
|