Skip to content

Instantly share code, notes, and snippets.

@yakunichkin
Created June 21, 2015 17:41
Show Gist options
  • Save yakunichkin/0b49cf03ae9e100ac957 to your computer and use it in GitHub Desktop.
Save yakunichkin/0b49cf03ae9e100ac957 to your computer and use it in GitHub Desktop.
Animation UpButton scrolling
<script type="text/javascript">
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
});
</script><!--Animation UpButton scrolling-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment