Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. /**
  2. * ::::::: Scroll Down
  3. */
  4. var $viewportHeight = $(window).height();
  5. var $target_down = $('#target-down');
  6. // Download the viewport
  7. $target_down.click(function(event){
  8. $('html, body').animate({scrollTop: '+=' + $viewportHeight}, 800);
  9. });
  10. $(window).scroll(function() {
  11. // Check if reach bottom of the page
  12. if($(window).scrollTop() + $viewportHeight == $(document).height()) {
  13. $target_down.fadeOut( 500 );
  14. } else {
  15. $target_down.fadeIn( 500 );
  16. }
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement