Skip to content

Instantly share code, notes, and snippets.

@brianyang
Created October 10, 2016 03:05
Show Gist options
  • Save brianyang/cf2512c087318ccac436f3bb1d7513a5 to your computer and use it in GitHub Desktop.
Save brianyang/cf2512c087318ccac436f3bb1d7513a5 to your computer and use it in GitHub Desktop.
function d() {
if (j.length >= 1) {
var b = j.offset().top + j.height()
, c = g.scrollTop() + g.height()
, d = 100 - (b - c) / (b - g.height()) * 100;
a(".progress-bar").css("width", d + "%"),
d > 100 ? a(".progress-container").addClass("ready") : a(".progress-container").removeClass("ready")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment