MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / myFunction

Function myFunction

assets/js/page_scroll_indicator.js:2–7  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1 window.onscroll = function() {myFunction()};
2 function myFunction() {
3 var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
4 var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
5 var scrolled = (winScroll / height) * 100;
6 document.getElementById("myBar").style.width = scrolled + "%";
7 }

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected