- This topic has 14 replies, 3 voices, and was last updated 2 years, 11 months ago by Tom.
-
AuthorPosts
-
May 3, 2021 at 3:03 am #1761545Fredrik
The website i’m soon to launch is acting up in the menu.
The sub-menu is opening up, but when hovering on another menu choice the entire sub-menu remains open and jumps around.
I’ve added a video showing the issue.May 3, 2021 at 4:34 am #1761666DavidStaffCustomer SupportHi there,
is this on any specific device or browser ? Does it happen on a different browser ?
May 4, 2021 at 1:18 am #1763162FredrikIt happens in all major browsers.
May 4, 2021 at 2:02 am #1763222FredrikThe menu is using anchor links. Shouldn’t matter, but since it isn’t closed after scrolling down the page we can clearly see the issue if we’d try to navigate the menu.
May 4, 2021 at 9:18 am #1764133TomLead DeveloperLead DeveloperHi there,
What are you using for smooth scroll ability? Can you try our option in Customize > General?
May 5, 2021 at 11:02 pm #1766722FredrikIt’s probably using Beaver Builders built-in smooth scroll. Can’t find a way to disable it.
https://docs.wpbeaverbuilder.com/beaver-builder/advanced-builder-techniques/smooth-scrolling-tweaks-with-code/I activated GP smooth scroll, but no luck.
May 6, 2021 at 3:05 am #1766994DavidStaffCustomer SupportI found this topic – not sure it will be of any help – there is no way to disable the BB smooth scroll globally – but it seems you can selectively disable it using the
fl-no-scroll
CSS Classhttps://community.wpbeaverbuilder.com/t/beaver-builder-2-5-alpha/13955
May 6, 2021 at 11:22 pm #1768376FredrikThat also disables GP smooth scroll. It didn’t fix the issue.
May 7, 2021 at 7:38 am #1769215TomLead DeveloperLead DeveloperThat shouldn’t have any effect on the GP smooth scroll.
Last thing to do is write some javascript to fix it. Let’s try this:
var subMenuLinks = document.querySelectorAll( 'nav .sub-menu a' ); for ( var link = 0; link < subMenuLinks.length; link++ ) { subMenuLinks[link].addEventListener( 'click', function( e ) { subMenuLinks[link].closest( 'sfHover' ).classList.remove( 'sfHover' ); } ); };
Let me know if that works or not π
May 8, 2021 at 1:25 pm #1770696FredrikI added the script with GP elements, head hook. It didn’t solve the issues. It’s live on the site now.
May 9, 2021 at 5:43 am #1771095DavidStaffCustomer SupportHi there,
to add that code using a Hook Element first you need to wrap it inside script tags:
<script> /* Javacscript goes here */ </script>
Secondly you would use the
wp_footer
hook so the script is fired after the HTML has loaded.May 9, 2021 at 1:18 pm #1771678FredrikYes I did that. (not footer though)
I gave you guys the login. Might be faster if you login and try than tossing me around with changes? πMay 10, 2021 at 7:51 am #1772918TomLead DeveloperLead DeveloperHere we go, this seems to do the trick:
<script> var subMenuLinks = document.querySelectorAll( 'nav .sub-menu a' ); for ( var link = 0; link < subMenuLinks.length; link++ ) { subMenuLinks[link].addEventListener( 'click', function( e ) { setTimeout( function() { document.activeElement.blur(); }, 50 ); } ); }; </script>
We’ll get this fixed in the next version.
Thanks!
May 12, 2021 at 10:45 pm #1776768FredrikIt definitely did. Thanks π
May 13, 2021 at 7:35 am #1777704TomLead DeveloperLead DeveloperNo problem!
-
AuthorPosts
- You must be logged in to reply to this topic.