Today I built a JS JQ function that returns to the top. No more nonsense, there are pictures and the truth!
The code is very simple. You can just take it and put it in your own project. If you have any bugs, please leave me a message and we can improve it together
Method 2:
Main parameters:
scrollName: 'scrollUp', // Element ID
topDistance: '300', // Distance from top before showing element (px)
topSpeed: 300, // Speed back to top (ms)
animation: 'fade', // Fade, slide, none
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element
activeOverlay: false,
// Helps locate the page position to scroll to when the "Back to Top" button appears.
jquery code (ScrollUp.js):
$(function () { $.scrollUp({ scrollName: 'scrollUp', // Element ID topDistance: '300', // Distance from top before showing element (px) topSpeed: 300, // Speed back to top (ms) animation: 'fade', // Fade, slide, none animationInSpeed: 200, // Animation in speed (ms) animationOutSpeed: 200, // Animation out speed (ms) scrollText: 'Scroll to top', // Text for element activeOverlay: false, // set css color to display scrollup active point, e.g '#00ffff' }); });