Thursday, September 15, 2016

How to add a simple Back to top button to your blog



A very simple way to add a back to top button to your blog



Paste this code to your gadget:
<!--linap's "Scroll to top" superblogger3.blogspot.gr-->
<style>#totop{display:none; position:fixed; right:3%;bottom:10px;} #totop:hover{cursor:pointer; background:none;}
</style>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js' type='text/javascript'>
</script>
<a id="totop"><img src="your image path 80x80 px" width="80px" height="80px" />
</a>
<script type='text/javascript'>
$(function(){ $(window).scroll(function(){ if($(this).scrollTop()>200){$("#totop").show()}
else{$("#totop").hide()}}); $("#totop").click(function(){$("body,html").animate({scrollTop:0},700);return false})}); 
</script>

Replace your image path 80x80 px  with your image path 



Elm0D

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment

Navigate» Become author for this Blog

Manual Categories