Code Snippets

Scroll to Top with jQuery

Maan
Dec 30, 2013
1 min read
56 words

If your pages are long winded, it’s a good idea to provide viewers with an easy way to quickly/ automatically scroll back to the top of the page.

[javascript]
$(“a[href=’#top’]”).click(function() {
$(“html, body”).animate({ scrollTop: 0 }, “slow”);
return false;
});
[/javascript]

HTML code place where you want.

[html]
Back to Top
[/html]

View Source →WordPress Pagination Without A Plugin

Maan

Author

Maan is a Lead Frontend Engineer and Creative Director with 10+ years of industry experience blending UI/UX design with React-based development. A multifaceted practitioner, he has spent a decade turning abstract inspiration into deployed, scalable reality. Maan’s expertise lies in high-fidelity prototyping and component architecture, which he shares through insightful technical writing with the next generation of developers. His unique approach ensures that pixels not only meet passion but also rigorous performance standards.

View all posts

Continue reading

You might also like

Leave a Reply

Your email address will not be published. Required fields are marked *

Menu