How to add a Percentage Next to the Scroll Bar For a Blogger

How to add a Percentage Next to the Scroll Bar For a Blogger

Go to download
#1

 



How to add a Percentage next to the scroll bar for a blogger, With this addition, you will get a beautiful effect for your site next to the scroll bar in blogger blogs, which is adding a percentage next to the scroll bar with each descent or ascent that appears for a second and disappears


Explain how to install

1. Note the format >> writing

2. Using CTRL+F, search for </body> and place the following code on top of it

<script type='text/javascript'>
//<![CDATA[ var scrollTimer = null;
$(window).scroll(function() {
var viewportHeight = $(this).height(),
scrollbarHeight = viewportHeight / $(document).height() * viewportHeight,
progress = $(this).scrollTop() / ($(document).height() - viewportHeight),
distance = progress * (viewportHeight - scrollbarHeight) + scrollbarHeight / 2 - $('#scroll').height() / 2;
$('#scroll')
.css('top', distance)
.text(' (' + Math.round(progress * 100) + '%)')
.fadeIn(600);
if (scrollTimer !== null) {
clearTimeout(scrollTimer);
}
scrollTimer = setTimeout(function() {
$('#scroll').fadeOut(600);
}, 1000);
});
//]]>
</script>
3. Find and </head>place the following code below



<div id='scroll'></div>

4. Now we move to the style search for ]]></b:skin>and then put the code above it
#scroll {
display:none;
position:fixed;
top:0;
right:15px;
z-index:500;
padding:3px 8px;
background-color:#369fcf;
color:#fff;
border-radius:3px;
font-size:14px;
}
#scroll:after {
content: " ";
position: absolute;
top:50%;
right:-10px;
height:0;
width:0;
margin-top:-6px;
border:6px solid transparent;
border-left-color:#369fcf;
}




image quote pre code