Avada Forums Community Forum How to use Off canvas menu with anchor link

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Reelax07
    Participant
    Post count: 1

    Hello everyone

    I’m trying to use off canvas to construct an anchor link menu
    The menu works well but my problem is when i click on anchor link the page goes to the anchor but the menu stay display… i would like to make it disappear by clicking on menu element.

    I tried to check if there was option to do that but seems not.
    I think i have to use Javascript… i’m not really usted to use it
    I try several things by looking on other site but development and me are not friend

    <script>
    jQuery(function($) {
    $(‘.menu-item’).on(‘click’, function() {
    awbOffCanvas.close_off_canvas();
    });
    });
    </script>

    anybody has an idea or maybe could make me on the track ?

    Thanks in advance

    danielvasilios
    Participant
    Post count: 10

    I’m having the exact same problem, did you find a solution?

    scsedel
    Participant
    Post count: 1

    I found this working

    jQuery(document).ready( function($) {
    
        $(document).on('click', '.awb-off-canvas-wrap a', function() {
    
            window.awbOffCanvas.close_off_canvas("<n>");
        });
    });

    where <n> is the id of the off canvas post.
    You can get this from inspecting code too. The offcanvas as an id like awb-oc-<n>.
    My routine closes the off canvas for each navigation item. You have to fit it for your needs.

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