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

    #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


      #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


        #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