[Resolved] Add transition to mobile menu

Home Forums Support [Resolved] Add transition to mobile menu

Home Forums Support Add transition to mobile menu

Viewing 3 posts - 31 through 33 (of 33 total)
  • Author
    Posts
  • #2494820
    Chris

    Hey guys, just re-opening this topic.. I have the following code for a mobile header transition (based off of Tom’s recommendations.

    The main menu slides in and out well, however the sub menu only transitions out and does not have a transition when closed (it snaps shut).. Could someone please have a look and see what is missing? I am using the standard mobile header

    @media (max-width: 768px) {
      
        #mobile-header .main-nav > ul,
        #mobile-header .main-nav .sub-menu {
            display: block;
            max-height: 0;
    	width: 100%;
            overflow: hidden;
            transition: max-height 400ms ease-in-out, opacity 0s ease-out;
            opacity: 0;
    	overflow: hidden;
        }
    
        #mobile-header.toggled .main-nav > ul,
        #mobile-header .main-nav .sub-menu.toggled-on {
            max-height: 1000px;
    	width: 100%;
    	transition: max-height 600ms ease-in-out, opacity 600ms ease-out;
            opacity: 1;
            overflow: hidden;
        }
    }
    #2494827
    Chris

    What would be the “toggled-off” css class for the sub menu?

    #2495124
    David
    Staff
    Customer Support

    Hi there,

    .sub-menu vs .sub-menu.toggled-on the former is what covers the toggled off state.

    Is it possible to see the site and i can take a look at whats going on.

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