- This topic has 7 replies, 3 voices, and was last updated 3 years, 4 months ago by Tom.
-
AuthorPosts
-
November 30, 2020 at 7:42 am #1558670FunkyCss
Hallo, i am going to use Generatepress for a one page website and i would like to ask if there is any tip to make the off canvas panel like a sticky navigation for the sections inside the page.
I have made off canvas sticky and i have set my links for the sections and is working smoothly.
But what i need to do is the off canvas to stay opened so it works like a navigation that moment on pc, i need only to be closed when i click the x button actually.
Any recomendations to start doing that ?
November 30, 2020 at 5:11 pm #1559492ElvinStaffCustomer SupportHi,
I’m not sure I understand what you mean. Off-canvas menu stays open when you open it as long as you don’t close it or you go to another page.
To clarify: you want the off-canvas menu to stay open when you browse through other pages?
Unfortunately this isn’t possible without significant site customization and this kind of customization is out of our scope.
But to give you clues as to what you may need, search for AJAX navigation.
December 1, 2020 at 1:16 am #1559927FunkyCssHi thanks for the feedback, i actually dont need the off canvas to stay open on other pages.
I am creating a one page site where i need the off canvas as my menu with inside the anchor links not pages.
Like the link i provide down
Where i dont want an overlay on the opening of canvas, i want the off canvas to stay open as you click on the anchor links an navigate throu the page.
is possible ?
December 1, 2020 at 9:26 am #1561238TomLead DeveloperLead DeveloperThis goes against how it’s built to work, but you could try adding some javascript like this:
var slideoutLinks = document.querySelectorAll( '.slideout-navigation ul a' ); for ( var i = 0; i < slideoutLinks.length; i++ ) { slideoutLinks[i].removeEventListener( 'click', 'closeOffsideOnAction', false ); };
Let me know ๐
December 1, 2020 at 9:38 am #1561298FunkyCssHallo Tom thank you so much for your nice code, i made a hook in entire page, at the end of the wp footer but it looks like is not working , when i click it it will close unfortunetaly , did i miss something ?
on the console – > closeOffsideOnAction is not defined
slideoutLinks.removeEventListener( 'click', <strong>closeOffsideOnAction</strong>, false );
December 1, 2020 at 1:19 pm #1562098TomLead DeveloperLead DeveloperCan you try the updated code above and increase the priority of the hook to something like
100
?December 3, 2020 at 3:54 am #1565422FunkyCssHi TOM , this still will not work , but i find it more easy to create a custom header as the project needs more things on this one and i dont want to be a weight here on forum asking for this kind of support.
Once again thank you so much for the guide, also Elvin for recomending Ajax Nav , that is a nice idea that i have already managed to create in onother project!
December 3, 2020 at 2:10 pm #1566462TomLead DeveloperLead DeveloperSounds good! Thank you ๐
-
AuthorPosts
- You must be logged in to reply to this topic.