Announcement

Collapse
No announcement yet.

Scroll To Top in Slide in Menu

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

  • 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.
    Chris Dye
    http://www.kseriesparts.com

  • 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.
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • to the top of the menu, not the page. so it would need to scroll to the top inside the slide in menu div.
      Chris Dye
      http://www.kseriesparts.com

      Comment


      • 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});
        Chris Dye
        http://www.kseriesparts.com

        Comment

        Working...
        X