Archived topic
Off Canvas Panel disappears before new page loads
9 replies · Started by Jakub on August 5, 2020
Hi,
I am using the off canvas menu for mobile on my site. When I click on of the menu items the Off Canvas Panel disappears, the current page is displayed and then the new page loads. I think it would look nicer without the brief jump back to the current page. Is there a way to keep the Off Canvas Panel displayed until the new page is shown?
Hi there,
which device are you seeing this on? Or any particular link ?
Its behaving normally on my iphone which is to navigate to the new page before closing.
It works fine on Safari (both desktop and ios).
I see the error on desktop Chrome and Firefox as well as mobile Chrome and Samsung Internet App.
Hi there,
This functionality is intended. However, you may be able to disable it with some custom javascript: https://gist.github.com/generatepress/35c505f1aac124edf071f9008061ee6d
If you don't have a javascript file to edit, you can use the wp_footer hook in a Hook Element. Just be sure to wrap the code in <script> tags:
<script>
// The JS in here
</script>
Hi Tom,
I've added the code you gave into the wp_footer via hook element, but the functionality doesn't seem to have changed.
Can you try giving the Hook Element a high priority? Something like 1000.
Let me know :)
I've set the priority to 1000, but I think nothing changed.
Can you try the updated code?: https://generatepress.com/forums/topic/off-canvas-panel-disappears-before-new-page-loads/#post-1388416
It works now. Thank you Tom!
You're welcome! :)