Skip to content

Commit

Permalink
MOD: rename getContentHeight function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-nginx authored Sep 12, 2017
1 parent 43dd4b4 commit 61086aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/js/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ NexT.utils = NexT.$u = {
$top.toggleClass('back-to-top-on', window.pageYOffset > THRESHOLD);

var scrollTop = $(window).scrollTop();
var contentHeight = NexT.utils.getContentHeight();
var scrollPercent = (scrollTop) / (contentHeight);
var contentVisibilityHeight = NexT.utils.getContentVisibilityHeight();
var scrollPercent = (scrollTop) / (contentVisibilityHeight);
var scrollPercentRounded = Math.round(scrollPercent*100);
var scrollPercentMaxed = (scrollPercentRounded > 100) ? 100 : scrollPercentRounded;
$('#scrollpercent>span').html(scrollPercentMaxed);
Expand Down Expand Up @@ -263,12 +263,12 @@ NexT.utils = NexT.$u = {
return scrollbarWidth;
},

getContentHeight: function () {
getContentVisibilityHeight: function () {
var docHeight = $('#content').height(),
winHeight = $(window).height(),
contentHeight = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight);
contentVisibilityHeight = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight);

return contentHeight;
return contentVisibilityHeight;
},

/**
Expand Down

0 comments on commit 61086aa

Please sign in to comment.