Created
August 31, 2019 12:41
-
-
Save bilalmalkoc/8d544a291259bb6f3ba9bc7c478f6ed0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
var winHeight = $(window).height(), | |
docHeight = $(document).height(), | |
progressBar = $('.wpuprogress'), | |
max, value; | |
max = docHeight - winHeight; | |
$(document).on('scroll', function(){ | |
value = $(window).scrollTop(); | |
progressBar.css('width', value / max * 100 + '%' ); | |
}); | |
$(window).on('resize', function() { | |
winHeight = $(window).height(); | |
docHeight = $(document).height(); | |
max = docHeight - winHeight; | |
progressBar.css('width', value / max * 100 + '%'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment