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.

Reply To: 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? Reply To: Is it possible to do not hide menu on touchscroll?

#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.