Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function () {
- var top = 100 ,
- speed = 600 ;
- $(window).scroll(function () {
- $(this).scrollTop() > top) ? $('#back-top').fadeIn() : $('#back-top').fadeOut();
- });
- // scroll to top on click
- $('#back-top a').click(function () {
- $('body,html').animate({scrollTop: 0}, speed);
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement