Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1343991

    Dear Kriesi-Team,
    on a website I only use a menu and header created within layer slider (default menu is hidden on every page). I want to setup version of for mobile devices wich should contain only a hamburger menu icon.
    My question: is there a link to trigger the appearance of the mobile menu? It should react like the regular Burger-Menu-Button which is automatically createt by the theme.
    thank you in advance,
    Wolfram

    #1344079

    Hey Wolfram,

    Yes, the mobile menu is just hidden and is using media query to trigger it: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
    If the device used to view the site has a width of 767px or less, the mobile menu will be shown (if you resize your browser you’ll see this show up as well)

    Best regards,
    Nikko

    #1344104

    Good Morning Nikko,
    thank you for the quick reply. Maybe I did express this the wrong way.
    On every page of this website the menu is hidden because I had to build my own menu within the layerslider. There will be a second Layerslider containing just a (self built) Burgermenu-Button. I need a way to trigger the (enfold)-mobile menu with this button if this is possible at all. If you want to take a look I‘ll provide you with the website-data.
    I also put a (temporary) big Burger-Button in the Layerslider…

    best regards,
    Wolfram

    #1344144

    Hi,
    Thank you for the link to your site, typically you would add a custom class such as custom-menu-toggle to the element you want to trigger the mobile menu and then add this script to the end of your functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
        <script>
    (function($){
      $(".custom-menu-toggle").on('click', function() {
        $('.av-hamburger').trigger('click');
      });
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    but I don’t see the header in the source code on your homepage, you will need to enable this to show the burger menu.
    The burger menu is created on click from the main menu, so the main menu and header must be on the page for the burger menu to be created.

    Best regards,
    Mike

    #1344170

    Hey Mike,
    thank you. I will try this solution and get back to you. It could take a little while since I‘m not realy an exprt in php. I deactivated the headers because I thougt i dont need them but luckily this is an easy fix…
    Best regards,
    Wolfram

    #1344195

    Hi,
    Ok, we will wait to hear back from you.

    Best regards,
    Mike

    #1345160

    Good evening Mike,
    the short story: It did not work.
    here‘s what I did: I activated the header on the start page, copied your code to the functions.php and created the class you suggested
    I also put a link to the element (thougt, there must be a link :/ ) but nothing happens.
    So probably I made a mistake somewhere since I know nothing about php. I‘m not sure there is a solution for my specific problem. Maybe you could have another look or I will try to find a different solution.
    best regards,
    Wolfram

    #1345190

    Hi,
    Thanks for your feedback, as I understand your plan from your first post, the burger icon in the layerslider is going to be for your mobile view and doesn’t need to work on desktop, so I changed the link in the layerslider burger icon to #custom-menu-toggle and changed the function to this:

    
    
    function custom_script() { ?>
        <script>
    (function($){
      $('a[href*="#custom-menu-toggle"]').on('click', function() {
        $('.av-hamburger').trigger('click');
      });
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    now the layerslider burger icon opens the theme burger menu on click on devices below 990px.

    Best regards,
    Mike

    #1345261

    Hey Mike,
    thank you so much. Now it works like it is intendet and I only have to figure out a way to hide the normal menus while they are still there (think the answer is in this thread (https://kriesi.at/support/topic/activate-the-mobile-menu-past-990px/).
    But again, thank you + I‘ve learnt a lot :)

    Best regards,
    Wolfram

    #1345263

    Hi,
    Glad to hear, to hide the header and mobile menu try this css:

    .responsive #top #wrap_all #header .av-hamburger {
    	visibility: hidden;
    }
    .responsive #top #wrap_all #header  {
    	height:0;
    }

    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1345584

    Good evening Mike,
    everything is fine now so thank you again for your help.
    … and this also applies for the whole kriesi support team: You‘re incredible!
    best regards,
    Wolfram

    ps.: Ich think you can close this thread now :)

    #1345600

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘open (or link) the mobile menu from button within Layerslider’ is closed to new replies.