Page Menu (submenu) "close on click"

10 replies · opened Feb 17, 2020

SstookyFeb 17, 2020

hello semicolon

I do have another question on my current project.

On bigger screens I use a headline and buttons to scroll to page sections.
On smaller screens I want to substitute the whole section with the page-nav/submenu feature.

I have set all css and < 768px the page-nav only is shown, >768 the section with headline an buttons is shown.
so far so good ... ver nice feature by the way!

My question is, how to make the page-nav automatically close on clicking a menu item.
The list elements are all scrollto anchors on the same page.
I would be great if you could help me out with this.

Click on menu item -> scrollto anchor | works propperly
But when scrolling back up on mobiles the pagen-av is still open.
Love to have it close automatically when item is clicked.

thx and rgds
GUIDO

SSemicolon WebSTAFFFeb 17, 2020

Hello,

  1. Change the Page Menu into a .one-page-menu as in the following code which will make the menu close on scroll on mobile devices:

&#x9;
- [Home](#wrapper)
&#x9;
- [About](#section-about)
&#x9;
- [Works](#section-works)
&#x9;
- [Services](#section-services)
&#x9;
- [Blog](#section-blog)
&#x9;
- [Contact](#section-contact)

This is just an example and you will still need to apply these codes according to your Menu Values and Anchors.

  1. This issue is because of your custom codes which is: id="page-menu-wrap nobg" and is incorrect HTML. The correct HTML should be id="page-menu-wrap" class="nobg" .

This will definitely fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SstookyFeb 17, 2020

hiho

stickyness works, my fault, I had not recognized that there was an artefakt in the id.

but auto close does not work unfortunately :-(
I tried to play around with your code but did not suceed.

it is this part of the code I would like to auto close:

		
			
				
					Übersicht und Preise
					
						
							
- [Basic Facials](#) 
							
- [AntiAge/Lifting](#)  
							
- [Special Treatments](#)  
							
- [Microdermabrasion](#)  
							
- [Mani-/Pediküre](#)  
							
- [Massage](#)  
							
- [Permanent MakeUp](#)   
							
- [Waxing](#)    
							
- [Men Only](#)     
							
- [Kuren](#)  
						
					
					
				
			
		
SSemicolon WebSTAFFFeb 19, 2020

Hello,

Once you start using .one-page-menu, all the data-scrollto should be changed to data-href. Make sure that you check all the codes. Example:


&#x9;
&#x9;&#x9;
- [Basic Facials](#section-basic)
&#x9;&#x9;
- [AntiAge/Lifting](#section-antiage)
&#x9;&#x9;
- [Special Treatments](#section-special)
&#x9;&#x9;
- [Microdermabrasion](#section-microderma)
&#x9;&#x9;
- [Mani-/Pedik&uuml;re](#section-manipedi)
&#x9;&#x9;
- [Massage](#section-massage)
&#x9;&#x9;
- [Permanent MakeUp](#section-perma)
&#x9;&#x9;
- [Waxing](#section-waxing)
&#x9;&#x9;
- [Men Only](#section-men)
&#x9;&#x9;
- [Kuren](#section-kuren)
&#x9;

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SstookyFeb 19, 2020

suped duper, workz exactly as aspected.

thx a lot,
guido

SstookyFeb 19, 2020

hmhhh ... funny enough on ipads in portrait mode the submenu does NOT close automatically :-(
on other sizes/devices it works.

am I missing sth or doing wrong?

sorry to be a pest, but could you give it another eyes on ipads in protrait format
this page

http://ek.web.my1.cc/anwendungen.html
user semicolon
pwd ektypo3_2020

the submenu nav does still not close automatically when a menu item is clicked.
on the attached screenshot I use safari responsive simulator
opened the nav - clicked on massage - the page scrolls to correct section
but does not close auto.

sorry once, again thx a bunch for your support and rgds
guido

SstookyFeb 20, 2020

it maybe useful for canvas-users how find this thread

if on devices with exactly 768px screenwidth and the submenu dropdown nav does not close on click ... find in functions.js

onePageScroll: function(){
          ...
          .
          .
          if( windowWidth < 768 || $body.hasClass('overlay-menu') ) {

and replace the
< 768
with
<= 768
that way even on e.g. iPadMini or iPad who have exactly 768px in portrait mode the dropdown as seen in the screenshot will close on click

nvm ... this is herewith fixed IMHO

@semicolon:
might be worth integrating that in next release?!

rgds,
guido

SSemicolon WebSTAFFFeb 21, 2020

Hello,

Yes! Thanks for posting the Solution. Simply changing the 768px to a Higher Number (if you want to target a Larger iPad like 992px) will fix this issue.

@stooky Yes, this will be available in the Next Update.

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard