Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- $(window).scroll(function () {
- var s = $(this).scrollTop(),
- d = $(document).height()-$(window).height(),
- scrollPercent = 0;
- if($(this).scrollTop()< $('.separator').position().top){
- scrollPercent = (s / d)*100;
- $("#progressbar").attr('value', scrollPercent);
- }
- else{
- scrollPercent = (( $(this).scrollTop() - $('.separator').position().top )/ d)*100;
- $("#progressbar").attr('value', scrollPercent);
- }
- });
- });
Add Comment
Please, Sign In to add comment