Adding The Widget
<style>
#sbtbacktotop{
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR-pwkQbiwl7E7Ity5nHD4NHGF6HF-d7c3zt5KkneeldOXHPY9EoGujiL1nvKxB2Hui45OjVscFFI_GAkg76EZ8l8EQWp_3E79A99z8f1y1kaZ3LfR3cBqA7jBJjQzoICrNGI4Wxpp0sAS/s1600/back-to-top-sprite-30224d9b.png) 0 0 no-repeat;
height: 130px;
width: 72px;
padding:5px;
position:fixed;
bottom: 5px;
right: 5px;
cursor:pointer;
transition:none;
z-index:15;
}
#sbtbacktotop:hover{
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR-pwkQbiwl7E7Ity5nHD4NHGF6HF-d7c3zt5KkneeldOXHPY9EoGujiL1nvKxB2Hui45OjVscFFI_GAkg76EZ8l8EQWp_3E79A99z8f1y1kaZ3LfR3cBqA7jBJjQzoICrNGI4Wxpp0sAS/s1600/back-to-top-sprite-30224d9b.png)no-repeat;
background-position: 0 -142px;
}
</style>
<!– Back to top button by SBT –>
<script src=’https://ift.tt/2pIbMWC>
<script type=’text/javascript’>
//<![CDATA[
$(window).scroll(function(){if($(this).scrollTop()>100)
{$(“#sbtbacktotop”).removeAttr(“href”);$(“#sbtbacktotop”).stop().animate(
{bottom:”0″},{duration:100,queue:false})}
else{$(“#sbtbacktotop”).stop().animate({bottom:”30000″},
{duration:8000,queue:false})}});$(function()
{$(“#sbtbacktotop”).click(function()
{$(“html, body”).animate({scrollTop:0},”slow”);
return false})});
//]]>
</script>
<!– Code provided to you by sbt –>
<a href=’#’ id=’sbtbacktotop’></a>
If you already have jQuery in your blog then remove Red highlighted code. Finally Click the save button to complete the setup.
No comments:
Post a Comment