Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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?

    Iphone Screenshot

    #1041829

    Guys,

    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

    #1043488

    Hi,

    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,
    Ismael

    #1043706

    Ismael,

    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.
    Peter

    #1046152

    Hi,

    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,
    Ismael

    #1046902

    Ismael,

    I was expecting this to close either after selection or after scroll. This seems a bit dissapointing

    Pete

    #1047090

    Hi,

    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,
    Ismael

    #1047260

    Ismael,

    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

    #1047616

    Hi,

    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,
    Ismael

    #1089497

    The 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.

    #1089817

    Hi,

    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,
    Ismael

    #1090152

    the 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 ?

    #1091231

    Hi,

    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

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.