Various preferences of customers define the layout of their forms. Some prefer the forms with tabs, others – everything on one page. Quite often you can have big forms and tabs all together. At the end of each tab users have to scroll to top every time, if they want to switch to the next tab.
In the post How to place a view above tabs I already described, how you can move certain views above the tabs. But here I will show you, how to create a ‘Scroll to top’ button, that appears only, when you start scrolling down.
1. Adding a Scroll to top button
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20)...
And you can click the image below to see the result:
2. Adding a Scroll to top icon
And this is how the final result looks like: