Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $(window).scroll(function(){
- if ($(this).scrollTop() > 160) {
- $('.scrollToTop').fadeIn();
- } else {
- $('.scrollToTop').fadeOut();
- }
- });
- $('.scrollToTop').click(function(){
- $('html, body').animate({scrollTop : 0},800);
- return false;
- });
- });
- <div class="scrollToTop-container">
- <a href="#" class="scrollToTop"><img src="img/icon_arrow_up.png" width="24" height="24" /> <br/>Scroll to top</a>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement