Forum Discussion

AlexBoehnke's avatar
8 years ago

Button: Jump to top of the site

Hello together,   I´m searching for the funktion: Button: Jump to top of the site. Background: If we have Threads with many postings, it's easier to click a button "go to top" then scroll all the ...
  • ClaudiusH's avatar
    8 years ago

    Hi Alex,

     

    Lithium doesn't provide an out of the box component for that functionality.

    You would basically need to create a custom component that shows a button, position and style that via CSS and finally attach via jQuery a click handler to do something like

    $('html, body').animate({ scrollTop: 0 }, 'fast');

    to scroll to the top via a smooth animation. See also https://stackoverflow.com/questions/4147112/how-to-jump-to-top-of-browser-page

     

    Feel free to get inspired by inspecting some relevant elements via the web developer tools of your choice here on the Lithium Community.