Scroll Progress Indicator Implement

#scrollIndicatior(style="height:6px;background-color:#ffe403;width:0;")
window.onscroll = function () { scrollIndicatior() };

function scrollIndicatior() {
  var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
  var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
  var scrolled = (winScroll / height) * 100;
  vars.scrollIndicatior.style.width = scrolled + "%";
}

https://www.w3schools.com/howto/howto_js_scroll_indicator.asp

Facebook 外掛功能

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *