Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Is it possible to do not hide menu on touchscroll?

Home Forums Older releases 1.0.x Is it possible to do not hide menu on touchscroll?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2978
    dimoncheg777
    Participant

    Hello!

    The problem is that if i have a long menu and want to scroll the page down (e.g. on iphone) to see all menu items, it hides 🙁 How to fix that?

    Thank you!

    #2980
    admin
    Keymaster

    Hi, normally you should be able to scroll the page without reseting the sub menus. They should be reset only on single tap.

    Does this happen for you on some of the default demos? If not, please post an URL to a live demo where I could see the issue and also mention what iPhone/iOS version you are using.

    Thanks!

    #2981
    dimoncheg777
    Participant

    Thank you for a fast reply!

    Your demo works fine, this happened only for my menu (on iOS 9 iPhone / iPad), live demo here http://821.8d7.myftpupload.com/

    my menu options:

    $headerMenu.smartmenus({
    	showTimeout: 0,
    	subMenusSubOffsetY: 0,
    	subIndicatorsPos: 'append',
    	subIndicatorsText: '',
    	subMenusMaxWidth: 'none',
    	keepInViewport: false,
    	showFunction: function($ul, complete) { $ul.fadeIn(250, complete); }
    });

    i’m not sure what i’m doing wrong, if you could help me, that’s would be great 🙂

    #2984
    admin
    Keymaster

    Thanks for sharing the demo, really helped a lot. It’s not related to the SmartMenus script. It’s caused by the following line:

    $('#header-menu').not('.wproto-hidden').hide();

    in the window resize handler you have:

    			// Init Responsive Tabs
    			$( window ).resize(function() {
    				self.initResponsiveTabs();
    				
    				if( $(window).width() > 995 ) {
    					$('#header-menu').not('.wproto-hidden').show();
    					$('#wproto-mobile-menu').hide();
    				} else {
    					$('#header-menu').not('.wproto-hidden').hide();
    					if( ! $('#primary-nav-menu').hasClass('wproto-search-displayed') ) {
    						$('#wproto-mobile-menu').css('display', 'inline-block');
    					}
    				}
    				
    			});

    in:

    http://821.8d7.myftpupload.com/wp-content/themes/wpl-exe/js/front.js?ver=300820152142

    If you are sure you need that line, I would suggest using a variable that saves the viewport width on every resize event and only processing the code in the handler if the width has changed since the previous resize because on iPhone the window resize event is fired on every page scroll too.

    #2986
    dimoncheg777
    Participant

    Dear friend, thank you so much for your help! I was really surprised that resize event is fired on every page scroll, it explains everything!

    Thank you so much for your time, I do not know how to thank you!

    #2991
    admin
    Keymaster

    Np at all! Cheers!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘1.0.x’ is closed to new topics and replies.