Scroll to Top with jQuery

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 →

0 Likes
Maan
Maan

21 year old designer, blogger and front-end developer. love to share creative design and inspiration.

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

div#stuning-header .dfd-stuning-header-bg-container {background-image: url(http://www.downgraf.com/wp-content/uploads/2017/04/login-back.jpg);background-size: cover;background-position: center center;background-attachment: scroll;background-repeat: no-repeat;}#stuning-header div.page-title-inner {min-height: 500px;}