Announcement

Collapse
No announcement yet.

Ability to scroll mobile menu - fix

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Ability to scroll mobile menu - fix

    If you have several sections then in Swift in mobile view only a certain number will be visible because the
    Code:
    div.header-section
    is fixed. This is so that the mobile nav bar stays visibile but it is annoying as you cannot scroll down to see all the section list.

    This is easily solved.

    Open the sylesheet and add the following lines to the bottom of the stylesheet but above
    Code:
     CSSDefinition;}
    if using php minification:
    Code:
    .your-extra-css {
    position:relative!Important;
    }
    #header-support-xs.your-more-css {
    display:none!Important;
    }
    Finally add the following to the javascript footer functions
    Code:
    $(".wsdownmenu-animated-arrow").click (function() {
    $('.header-section').toggleClass('your-extra-css');
    $('#header-support-xs').toggleClass('your-more-css');
    });
    When you click the hamburger the page will be scrollable, when you click again the mininav will be fixed.

    Try it here: https://www.graphiczdev.co.uk/wish/index.html
    Last edited by graphicz; 13-Jul-2020, 08:31 AM. Reason: Corrected incorrect line of code
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    Unfortunately there is a drawback with this. If the page is long and you are at the bottom (on your phone) and you click the menu 'hamburger' the menu bar disappears and you are left at the bottom of the page with nowhere to go!

    So, remove the script above from the js footer functions.

    Add this to the stylesheet:
    Code:
    .sectionMenu.mobile {
    height: 100%;
    overflow: auto;
    }
    .sectionMenu.mobile ul {
    overflow: auto;
    position: relative;
    max-height: 400px;
    }
    Please reply with any problems/improvements
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment

    Working...
    X