Variable Visions

Articles jQuery JQuery-animated-Scroll-to-Top-link


tutorials - jQuery and Web-Development.

JQuery animated Scroll to Top link

Published Tue. Jul. 31, 2012


This jQuery function converts the #jump anchor tag to a link that scrolls back to the top of the html body in two seconds with easing.

jQuery

jQuery('a[href=#jump]').click(function(){
        jQuery('html, body').animate({scrollTop:0}, 2000);
        return false;
        });


HTML

<a href="#jump">BACK TO TOP</a>



Tag(s): jQuery, scrollop, anchor tags



RECENT ARTICLES:

PUBLISHED ON 06.1.23arrowBuilding a JavaScript Metronome using Open AI Chat GPT

PUBLISHED ON 05.15.23arrowHow Do I Remove Footage Gaps in Adobe Premiere

TAGS

CATEGORIES