-
AuthorPosts
-
December 5, 2018 at 7:58 pm #1041358
Please got http://www.peter-test2.co.uk using a mobile devices (I used iphone 7 plus) and safari browser . Select from the top menu “products” and then from the full width sub menu “Durex”. The Full width menu after selection remains dropped down and hides the content of the website. Also the page after a few seconds seems to scroll up and down and I dont know why?
December 6, 2018 at 8:44 pm #1041829Guys,
Ok have upgarded to 4.5.1 and now sticky menu does stay at top of page on mobile sop that is now sorted, but still get other two issues:
1) On selection of sticky menu the dropdown still remains dropped down and hides the content of website, surely after selection this should not remain in dropped down position as per above screen shot
2) Also page content keeps scrolling very few seconds up and down
December 11, 2018 at 1:59 am #1043488Hi,
Thank you for using Enfold.
I can’t reproduce the issue on my own installation and I don’t see any errors on your site. Did you add any custom scripts or modifications to the site?
Best regards,
IsmaelDecember 11, 2018 at 11:46 am #1043706Ismael,
The issue is that when you select menu options from the sticky menu, the menu remains in place and on a mobile. You cant see any of the website screen content. Surely after selection of the menu option the menu list would go back to the burger menu allowing the user to read the content after selection.
PeterDecember 17, 2018 at 5:42 am #1046152Hi,
That is the default behavior of the menu. You have to click on something after opening the menu toggle to close the menu. Are you expecting it to close on scroll?
Best regards,
IsmaelDecember 18, 2018 at 3:14 pm #1046902Ismael,
I was expecting this to close either after selection or after scroll. This seems a bit dissapointing
Pete
December 19, 2018 at 3:36 am #1047090Hi,
I see. You can use this script to automatically close the menu on scroll.
add_action('wp_footer', 'ava_custom_close_menu_on_scroll'); function ava_custom_close_menu_on_scroll(){ ?> <script type="text/javascript"> (function() { const sm = document.querySelector('.av-submenu-container'); const sn = sm.querySelector('.av-subnav-menu') const st = sm.querySelector('.mobile_menu_toggle'); const eventClick = new Event('click'); if(sm) { document.addEventListener( 'scroll', (event) => { if( sn.classList.contains('av-open-submenu') ) { st.dispatchEvent(eventClick); } }); } })(); </script> <?php }
Best regards,
IsmaelDecember 19, 2018 at 5:29 pm #1047260Ismael,
Many thanks for this really helpful. However:
Have added into php file but is showing an error on this line………….document.addEventListener( ‘scroll’, (event) => {
Can you help please
Many Thanks
Peter
December 20, 2018 at 10:11 am #1047616Hi,
Did you copy the code from your email? Please copy it directly from the forum. Some of the characters were probably converted to their html entity code.
Best regards,
IsmaelApril 11, 2019 at 10:52 am #1089497The other scripts on board do not realy work to close on click. This one does.
How to have it only for click event? i do not need the close on scroll.April 12, 2019 at 2:29 am #1089817Hi,
You may need to change the event from “scroll” to “click” on this line:
document.addEventListener( 'scroll', (event) => {
And then you probably need to check if the clicked target is not a menu item or the menu container. Something like…
if( event.current.target == 'menu_selector_here' ) return;
Best regards,
IsmaelApril 12, 2019 at 9:51 pm #1090152the replacement of scroll event is so far clear to me.
but what selector do i have to put in? the click on menu : the a tag itself ?April 16, 2019 at 7:16 am #1091231Hi,
Are you trying to close the sub menu by clicking anywhere on the page? You can leave the document selector there and just check if the clicked item is the sub menu container. If it is, then you have to cancel the event dispatch or do something else.
// https://developer.mozilla.org/en-US/docs/Web/API/Event/target
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.