Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<div id="page_top"><a href="#"></a></div>
<script>
$(window).scroll(function(){
var now = $(window).scrollTop();
 if(now > 500){
   $("#page_top").fadeIn("slow");
  }else{
   $("#page_top").fadeOut("slow");
  }
 });
 $("#page_top").click(function(){
  $("html,body").animate({scrollTop:0},"slow");
 });
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://hatena.wackwack.net/v1.1/js/breadcrumb.min.js"></script>
<script src="https://hatena.wackwack.net/v1.1/js/category_archive.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment