forked from mirror/_s
Merge pull request #15 from joshmcrty/master
The .click() event in small-menu.js that toggles the .menu element is re-bound each time the window is resized. This causes multiple .click() events to be bound to the .menu-toggle element, effectively cancelling out the .toggle() function every other time the window is resized. By using .unbind( 'click' ) before .click(), this is no longer an issue.
This commit is contained in:
commit
2150be2d97
|
@ -9,7 +9,7 @@ jQuery( document ).ready( function( $ ) {
|
|||
$masthead.find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' );
|
||||
$masthead.find( '.site-navigation h1' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' );
|
||||
|
||||
$( '.menu-toggle' ).click( function() {
|
||||
$( '.menu-toggle' ).unbind( 'click' ).click( function() {
|
||||
$masthead.find( '.menu' ).toggle();
|
||||
$( this ).toggleClass( 'toggled-on' );
|
||||
} );
|
||||
|
|
Reference in New Issue