Ads (728x90)






Masih di Variasi Blogger share Cara Membuat Persentase pada Scrollbar di Blog cekidot , Silahkan sobat Copy Paste script  di bawah ini simpan di blog sobat

klik Template >> klik Edit HTML >> kemudian cari kode ]]></b:skin> Kemudian Copy Paste kode Script dibawah ini dan simpan di atas kode tadi

#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);
}

Jika sudah Cari kembali kode </head> dan simpan kode dibawah ini sesudah kode tadi

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

satu langkah lagi silahkan cari kode </body> dan simpan kode script dibawah ini di atas kode tadi

<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>

Simpan Template dan lihat hasilnya , Semoga bermanfaat sobat oia untuk demonya sobat bisa lihat di Scrollbar blogs ini

Post a Comment

~Pengunjung yang shaleh dan shalehah pasti meninggalkan jejak ~
~Komentar yang menyertakan link aktif, iklan, atau titip link, akan dihapus~

::::::::::::::::::::::::::::::Powered by :Blogger Rizky in Here::::::::::::::::::::::::::::::::::