Created
December 7, 2018 11:27
-
-
Save patrickposner/cce38b5127f227a0951b6e3754a93e81 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| if ( $('body').hasClass('single-post') ) { | |
| window.addEventListener('scroll', function(e) { | |
| var s = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; | |
| var body = document.body; | |
| var html = document.documentElement; | |
| var d = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); | |
| var c = window.innerHeight; | |
| var position = (s / (d - c)) * 100; | |
| if ( $( "#atomion-progress-bar" ).length ) { | |
| $( "#atomion-progress-bar" ).css('width', position + '%'); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment