- This topic has 15 replies, 2 voices, and was last updated 7 months, 1 week ago by
Daniel.
-
AuthorPosts
-
June 10, 2020 at 4:50 am #1321907
Daniel
Hello,
Can you take a look at the page that I am preparing with your theme? When trying to add anchor links, the submenu is fixed instead of disappearing.Thank you!
June 10, 2020 at 5:25 am #1321943David
StaffCustomer SupportHi there,
This is what i tried – i hovered over the
Work with DDA
menu item. Selected either anchor link – if i reduce the height of my browser so the page has to scroll to the anchor link then the sub menu closes – because it is no longer hovered over.If however the browser isn’t long enough and doesn’t need to scroll then the the menu item remains hovered on which is why it stays open.
Is that the issue ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 10, 2020 at 5:51 am #1321980Daniel
Hello david,
the problem is that if I click on one of the submenu items, the link works, but the gray submenu continues.Ideally, when clicking, this submenu would disappear.
If I don’t explain, I can make you a little video if you want! π
June 10, 2020 at 6:01 am #1321993David
StaffCustomer SupportSo we can agree we are looking at the same thing – can you share a video ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 10, 2020 at 6:04 am #1321999June 10, 2020 at 6:17 am #1322008David
StaffCustomer SupportAah right ok.
Now good news is the GP Smooth Scroll option fixes that.
Bad news is you’re using Elementor and its smooth scroll cannot be disabled and will conflict with GPs smooth scroll.So instead – try following the JS method Tom provides here:
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 10, 2020 at 6:27 am #1322022Daniel
I am testing the method that you tell me, but it doesn’t work π
I have tried changing the name of the layer, etc. but it failsJune 10, 2020 at 6:59 am #1322057David
StaffCustomer Supportodd – site isn’t requesting jQuery.
Add this PHP Snippet to make sure jQuery gets loaded.add_action( 'wp_enqueue_scripts', 'tu_load_jquery' ); function tu_load_jquery() { wp_enqueue_script( 'jquery' ); }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 10, 2020 at 7:02 am #1322066Daniel
Sorry David, I add this php code into the hook?
June 10, 2020 at 7:04 am #1322072David
StaffCustomer SupportSorry – no it needs to be added in one of these ways:
https://docs.generatepress.com/article/adding-php/
Elementor really does make simple stuff difficult sometimes lol
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 10, 2020 at 7:17 am #1322088Daniel
Hi again,
i use code snippets, but the submenu don’t dissapear πAny other option?
June 10, 2020 at 7:36 am #1322111David
StaffCustomer SupportHmmm… try this JS instead:
jQuery( document ).ready( function( $ ) { $( '.main-navigation a' ).on( 'click', function() { var item = $('.sfHover'); item.removeClass( 'sfHover' ); } ); } );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/June 10, 2020 at 7:40 am #1322117Daniel
yessss! now works…. BUUUUUT, when i click the back to top button, the sub-menu appears again :___
June 10, 2020 at 8:03 am #1322291Daniel
with this, now works!
<script> jQuery( document ).ready( function( $ ) { $( '.main-navigation a' ).on( 'click', function() { var item = $('.sfHover'); item.removeClass( 'sfHover' ); } ); $( '.generate-back-to-top' ).on( 'click', function() { var item = $('.sfHover'); item.removeClass( 'sfHover' ); } ); } ); </script>
June 10, 2020 at 8:24 am #1322310David
StaffCustomer SupportGlad to hear that – and thanks for sharing!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.