- This topic has 7 replies, 3 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
March 3, 2023 at 11:21 am #2554475
Stefan
hello everybody,
I wonder if you can help me .
I want to have the submenu on show by default when I click the menu button on mobile view. how can I implement that ?
and can I use the css only for one navigation button and not for the whole navigation bar
the website is https://inkaholics.co.ukThank you in advance, Stefan
March 3, 2023 at 1:53 pm #2554596Ying
StaffCustomer SupportHi Stefan,
Can you try this CSS:
.main-navigation.toggled .main-nav ul ul.sub-menu { position: relative; top: 0; left: auto!important; right: auto!important; width: 100%; pointer-events: auto; height: auto; opacity: 1; display: block; visibility: visible; }March 3, 2023 at 2:44 pm #2554655Stefan
Hi thank yo u for the swift reply,
yes it works but when I press the little arrow on the right the dropdown doesn’t retract .. also can’t scroll down to the contacts .
wanted just the Artists one to be collapsed .
i have left live to see how it behavesMarch 4, 2023 at 5:36 am #2555182David
StaffCustomer SupportHi there,
you won’t be able to do it with CSS.
It would need some Javascript.1. Create a new Hook Element ( in Appearance > Elements ).
2. In the hook text area add this script:<script> const clickme = document.querySelector('#menu-item-584 .dropdown-menu-toggle') const elemHtml = document.querySelector('html') const mutateOptions = { attributes: true } function callback(mutationList, observer) { mutationList.forEach(function(mutation) { if (mutation.type === 'attributes' && mutation.attributeName === 'class') { // handle class change if (mutation.target.className == 'mobile-menu-open') { clickme.click(); } } }) } const observer = new MutationObserver(callback) observer.observe(elemHtml, mutateOptions) </script>3. Set the Hook to:
wp_footer
4. Set the Display Rules > Location toEntire Site
5. Publish the hook.March 5, 2023 at 2:30 am #2556063Stefan
Hi David ,
It worked amazing , no problem whatsoever .thank you again for your support.
Regards,StefanMarch 5, 2023 at 6:53 am #2556280David
StaffCustomer SupportGlad to hear that!
March 5, 2023 at 1:20 pm #2556706Stefan
Very happy with the technical support, and the generate press theme . Thank you
March 6, 2023 at 2:05 am #2557102David
StaffCustomer SupportGlad to be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.