Created
July 29, 2018 08:10
-
-
Save Takerrim/9d08559dcb6cf2c52cc3540478f8d1e2 to your computer and use it in GitHub Desktop.
Scroll page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.up').click(function(){ | |
$('html,body').animate({scrollTop: 0}, 500); | |
}); | |
$(document).scroll(function(){ | |
if($(document).scrollTop()>0) { | |
$('.up').fadeIn(); | |
} else { | |
$('.up').fadeOut(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment