Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // scroll to content button
- var $scrollToContentBtn = $('.js-scroll-to-content'),
- allowScrolling = true;
- allowAutoScrolling = $(window).scrollTop() === 0;
- $(window).scroll(function () {
- var $this = $(this);
- if ($this.scrollTop() > 0 && allowAutoScrolling) {
- $('html, body').animate({
- scrollTop: $this.height()
- }, 'slow');
- }
- allowAutoScrolling = $this.scrollTop() === 0;
- });
Add Comment
Please, Sign In to add comment