Blancamaco (Talk | contribs) |
|||
Line 287: | Line 287: | ||
</div> | </div> | ||
+ | |||
+ | |||
+ | <script> | ||
+ | // When the user scrolls the page, execute myFunction | ||
+ | window.onscroll = function() {myFunction()}; | ||
+ | |||
+ | function myFunction() { | ||
+ | var winScroll = document.body.scrollTop || document.documentElement.scrollTop; | ||
+ | var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; | ||
+ | var scrolled = (winScroll / height) * 100; | ||
+ | document.getElementById("myBar").style.width = scrolled + "%"; | ||
+ | } | ||
+ | </script> | ||
+ | |||
+ | |||
+ | |||
</footer> | </footer> |
Revision as of 10:15, 16 September 2018