Thursday, March 10, 2016

Cara Membuat Persentase atau Persen pada Scrollbar di Blog

Langkah :
1. Masuk Ke Blogger
2. Klik Edit HTML
3. Cari Kode ]]></b:skin>
4. Kemudian Copy Kode berikut ke atas ]]></b:skin>
#scroll { display: none; position: fixed; top: 0; right: 20px; z-index: 500; padding: 3px 8px; background-color: rgb(51, 51, 51); color: #fff; border-radius: 3px; } #scroll:after { content: " "; position: absolute; top: 50%; right: -8px; height: 0; width: 0; margin-top: -4px; border: 4px solid transparent; border-left-color: rgb(51, 51, 51); }
5. Cari Kode </head>
6. Kemudian Copy Kode berikut dibawah </head>
<div id='scroll'></div>
7. Cari Kode </body>
8. Kemudian Copy Kode berikut ke atas </body>
<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(100);
    if (scrollTimer !== null) {
        clearTimeout(scrollTimer);
    }
    scrollTimer = setTimeout(function() {
        $('#scroll').fadeOut();
    }, 1500);
});
//]]>
</script>
 9. Save Template

1 comments so far

Peraturan :
1. Dilarang Menggunakan Link
2. Dilarang Membuat Kata-kata Sex, porn, Dsb
3. Komentar Yang Positif.

EmoticonEmoticon

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:o
:>)
(o)
:p
:-?
(p)
:-s
8-)
:-t
:-b
b-(
(y)
x-)
(h)