• Resolved wladislav

    (@wladislav)


    Hi, your plugin is amazing, I love it!!!
    I want to open menu by swiping left/right, can you help me to realize this idea.
    Excuse for my bad English.
    Sincerely, Vladislav.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Rui Guerreiro

    (@takanakui)

    Hi,

    Thanks for using WP Mobile Menu.

    Thanks for the request at the moment that is something complex to implement and I don’t have enough time to do it. Will consider it for a future functionality.

    Thanks

    -Takanakui

    There’s a js repository where I saw yesterday a slide and swipe library that is available for this — you likely know, but just in case…

    How I can add it my case, please help me!

    Plugin Author Rui Guerreiro

    (@takanakui)

    You will have to get some help from a Freelancer developer.

    When the swipe movement is triggered you can add the code below to open the left menu.

    jQuery( '.mobmenu-left-bt' ).trigger( 'click' );

    Hope it helps.

    -Takanakui

    So I must add this code in mobmenu.js? I hope for your help.
    I have:

    jQuery(document).ready(function() {
            
            if ( jQuery( 'body' ).find( '.mobmenu-push-wrap' ).length <= 0 ) {
    
                jQuery( 'body' ).wrapInner( '<div class="mobmenu-push-wrap"></div>' );
                jQuery( '.mobmenu-push-wrap' ).after( jQuery( '.mob-menu-left-panel' ).detach() );
                jQuery( '.mobmenu-push-wrap' ).after( jQuery( '.mob-menu-right-panel' ).detach() );
                jQuery( '.mobmenu-push-wrap' ).after( jQuery( '.mob_menu_header_div' ).detach() );
                jQuery( '#wpadminbar' ).appendTo( 'body' );
    
            }
    
            jQuery( document ).on( 'click', '.mobmenu-left-bt, .mob-menu-left-panel .mobmenu_content a' , function ( ) {  
                  jQuery('body').toggleClass('show-nav-left'); 
                
                if ( jQuery( 'body' ).hasClass( 'show-nav-left') ){  
                    jQuery( 'body' ).css( 'overflow', 'hidden');  
                } else {
                    jQuery( 'body' ).css( 'overflow', '');  
                }
                
            });  
    
            jQuery( document ).on( 'click', '.mobmenu-right-bt, .mob-menu-right-panel .mobmenu_content a' , function ( ) {
                  
                
                jQuery('body').toggleClass('show-nav-right'); 
                
                if ( jQuery( 'body' ).hasClass( 'show-nav-right') ){
                    jQuery( 'body' ).css( 'overflow', 'hidden');  
                } else {
                    jQuery( 'body' ).css( 'overflow', '');  
                }
            });
    
            jQuery('.mobmenu_content .sub-menu').each( function(){
                jQuery( this ).before('<div class="mob-expand-submenu"><i class="mob-icon-down-open"></i><i class="mob-icon-up-open hide"></i></div>');
    
            });
            
            jQuery( document ).on( 'click', '.mob-expand-submenu' , function ( ) {
    
                  // Only autoclose when it isn't the opened sub menu
                  if( jQuery( this ).next()[0] != jQuery('.show-sub-menu')[0] ) {
                    
                    jQuery( '.show-sub-menu' ).hide();
                    jQuery( '.show-sub-menu' ).prev().find('.mob-icon-down-open').toggleClass('hide');
                    jQuery( '.show-sub-menu' ).prev().find('.mob-icon-up-open').toggleClass('hide');
                    jQuery( '.show-sub-menu' ).toggleClass( 'show-sub-menu');
        
                  }
                  
                  jQuery( this ).find('.mob-icon-down-open').toggleClass('hide');
                  jQuery( this ).find('.mob-icon-up-open').toggleClass('hide');
                  
                  if ( !jQuery( this ).next().hasClass( 'show-sub-menu' ) ) {  
    
                      jQuery(this).next().fadeIn( 'slow' );   
    
                  } else {
                      
                      jQuery(this).next().hide();   
    
                  }
    
                  jQuery(this).next().toggleClass( 'show-sub-menu');
                  
            });
    
        }); 

    Where I must add?:
    jQuery( '.mobmenu-left-bt' ).trigger( 'click' );

    Plugin Author Rui Guerreiro

    (@takanakui)

    If you aren’t a developer is difficult to explain because I also don’t know the place since it depends on the swipe functionality implementation. You need to hire a developer that can implement a swipe functionality, that line of code I provided you will open the menu but it has to be triggered when the Swipe movement is made and in that part I can’t help you.

    If it was something that could be done in the mobmenu.js I would tell you in what line it should be inserted.

    -Takanakui

    Thank you.
    Sincerely, Vladislav.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Swipeable menu’ is closed to new replies.