Add an option to close the Off-Canvas widget when a link inside is clicked #27727
Replies: 4 comments
-
+1 I brought this up in the beta version discussion. So I'll copy the feedback I gave there:
|
Beta Was this translation helpful? Give feedback.
-
+1
yes, but i need the link to scroll to an anchor & also close the off-canvas — double duty. solution? |
Beta Was this translation helpful? Give feedback.
-
Prerequisites
What problem is your feature request going to solve? Please describe..
I installed the new Offcanvas widget to my header (https://toptable.blackt.agency/)
It works fine for page links. But one of my menu items is an anchor link ("restaurants") to a section of the homepage.
When I click on "restaurants" it scrolls to the right section. But if I am in the home already, the offcanvas does not close after the click, it stays open.
The following code works for popups, if we could only update it to Offcanvas it would solve the issue.
<script> jQuery(function($){ $(document).on('click','.elementor-location-popup a', function(event){ elementorProFrontend.modules.popup.closePopup( {}, event); }); }); </script>Describe the solution you'd like.
Adapt the following code to work for Offcanvas (instead of Popups as it is now)
<script> jQuery(function($){ $(document).on('click','.elementor-location-popup a', function(event){ elementorProFrontend.modules.popup.closePopup( {}, event); }); }); </script>Describe alternatives you've considered.
No response
Additional context
No response
Agreement
Beta Was this translation helpful? Give feedback.
All reactions