Scroll To Top in Slide in Menu

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • K Series Parts
    Mivite

    • Jul 2006
    • 263

    #1

    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
  • Matt Zimmermann
    Mega Mivite










    • Apr 2008
    • 2482

    #2
    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

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment

    • K Series Parts
      Mivite

      • Jul 2006
      • 263

      #3
      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

      • K Series Parts
        Mivite

        • Jul 2006
        • 263

        #4
        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