Home >Web Front-end >JS Tutorial >jQuery Auto Scroll To Top Of Page
Use jQuery for Smooth, Automated Scrolling to the Top
This simple jQuery code snippet provides a smooth, automated scroll to the top of your webpage. Why use it? It saves users time scrolling on long pages and adds a visually appealing touch.
[Live Demo: jQuery Scroll to Top](Link to Demo - Replace with actual demo link if available)
Here's the code:
jQuery(document).ready(function($) { $('a[href=#topbar]').click(function(){ $('html, body').animate({scrollTop:0}, 'slow'); return false; }); });
Frequently Asked Questions (FAQs)
How do I implement this on my website?
<script></script>
tags, ideally just before the closing
The above is the detailed content of jQuery Auto Scroll To Top Of Page. For more information, please follow other related articles on the PHP Chinese website!