So, I would like my progress to increase, based on how far I have scrolled and how much is left.
I tried this: jsFiddle and it doesn't seem to work, I based my script with someone else's script that made the block move horizontally based on% scroll.
my code is:
HTML
<progress id="progressbar" value="0" max="100"></progress> <br /> <br /> <br /> Lorem<br /> Ipsum<br /> Dolor<br /> . . . .
Js
$(document).ready(function () { $(window).scroll(function () { var s = $(this).scrollTop(), d = $(document).height(), scrollPercent = (s / d); var position = (scrollPercent); $("#progressbar").progressbar('value', position); }); }); });
I donโt think I am doing it right (I tried to imitate another person and couldnโt)
javascript jquery html css progress-bar
hakarune
source share