Announcement

Collapse
No announcement yet.

Scroll To Top in Slide in Menu

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

  • K Series Parts
    started a topic Scroll To Top in Slide in Menu

    Scroll To Top in Slide in Menu

    Is there a piece of code that I could add that would scroll the left slide in menu back to the top when you click on an item with child menus? There is a certain point on mobile where you can click on a menu and it shows blank because you are at the bottom of the menu and have to scroll back to the top.

  • K Series Parts
    replied
    Turns out it was a simple fix if you add .animate({scrollTop: 0}) to the end of the selected.next('ul') line.

    Code:
    selected.next('ul').removeClass('is-hidden').end().parent('.has-children').closest('ul').addClass('show-next').animate({scrollTop: 0});

    Leave a comment:


  • K Series Parts
    replied
    to the top of the menu, not the page. so it would need to scroll to the top inside the slide in menu div.

    Leave a comment:


  • Matt Zimmermann
    replied
    Hi Chris,

    If you are looking to scroll to the top of the page, you might be able to utilize the 'smoothscroll' function in scripts.js by applying hooks and targets to the links you would like this to happen.

    Leave a comment:

Working...
X

This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

Accept