Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (sp(window).width() < 800) {
- sp( '.js-superfish' ).superfish( 'destroy' );
- }
- sp(window).resize(function() {
- if (sp(this).width() < 800) {
- sp( '.js-superfish' ).superfish( 'destroy' );
- sp( '.menu-item-has-children' ).removeClass( 'menu-open' );
- } else {
- sp('nav').removeAttr('style');
- sp( '.js-superfish').superfish({
- 'delay': 100,
- 'animation': {'opacity': 'show', 'height': 'show'},
- 'dropShadows': false
- });
- }
- });
- var mb_btn = '<button class="mobile-menu" id="mobile-menu" aria-pressed="false" aria-expanded="false" role="button">' +
- 'Menu <span class="icon ion-drag close"></span>' +
- '</button>';
- sp('.nav-header,.nav-secondary').before( mb_btn );
- sp( '.mobile-menu' ).click(function( event ) {
- if( sp(this).find('.icon').hasClass('close') ) {
- sp(this).find('.icon').removeClass('close ion-drag').addClass('open ion-android-close');
- }else{
- sp(this).find('.icon').removeClass('open ion-android-close').addClass('ion-drag close');
- }
- if( sp(this).next().is('.site-navigation') ) {
- sp(this).next('.site-navigation').find('nav').slideToggle();
- } else {
- sp(this).next('.nav-header,.nav-secondary').slideToggle();
- }
- });
- sp( '.menu .menu-item' ).click(function(event){
- patt = new RegExp( '#' );
- if ( ( event.target !== this ) && ( ! patt.test(event.target) ) )
- return;
- sp(this).find( '.sub-menu:first' ).slideToggle(function() {
- sp(this).parent().toggleClass( 'menu-open' );
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement