Anchor links and menu closing
-
Hi there,
Big fan of the plugin and saved me a bunch of time on my site, just wondered if there was a way to auto close the menu when anchor links are clicked?
I’ve seen a couple of people having this issue and having to add custom JS in order to fix it.
I did try this using Simple Custom CSS and JS but then realised I was using elementor’s theme builder to create a header and footer and so maybe the JS was being embedded on the theme’s (Astra) default footer and not being pulled through.
So, although bad practise, I tried inserting the same script in under an html tag when building the footer (shown below) however this still didn’t work.
Any further help you could give would be greatly appreaciated.
(FYI the only current anchor linked section is “FAQ”)
Thanks in advance
JS used in Simple Custom CSS and JS
( function() {
jQuery( document ).ready( function() {
jQuery( “.fsmfe-wrapper” ).find( “a” ).click( function() {
jQuery( this ).closest( “.fsmfe-wrapper” ).find( “.menu-toggle” ).prop( “checked”, false );
} );
} );
}() );JS embedded on footer manually
<script type=”text/javascript” src=”https://www.zig-zag.co/wp-content/uploads/custom-css-js/345.js”>
( function() {
jQuery( document ).ready( function() {
jQuery( “.fsmfe-wrapper” ).find( “a” ).click( function() {
jQuery( this ).closest( “.fsmfe-wrapper” ).find( “.menu-toggle” ).prop( “checked”, false );
} );
} );
}() );</script>
The page I need help with: [log in to see the link]
- The topic ‘Anchor links and menu closing’ is closed to new replies.