From 4c0d81db2c33f64a47838e900579f0f07476f9f1 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 6 Sep 2016 15:00:11 +0000 Subject: [PATCH] fix #675 @0:40 --- js/209-scrollify.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/js/209-scrollify.js b/js/209-scrollify.js index 748ad38..7144833 100644 --- a/js/209-scrollify.js +++ b/js/209-scrollify.js @@ -120,6 +120,8 @@ if (disabled === true) { return true; } + + if (names[index]) { scrollable = false; @@ -160,6 +162,9 @@ }); } else { + //fb('scroll to ' + index); + //alert(heights.join(',')); + //console.info(index + ' -- Scrolling to: ' + heights[index] + ' | ' + settings.scrollSpeed + ' | ' + settings.easing); @@ -239,7 +244,7 @@ manualScroll.calculateNearest(); } }, - handleScroll: function () { + animateScroll: function () { if (disabled === true) { return true; } @@ -471,27 +476,22 @@ }, down: function () { if (index <= heights.length - 1) { - if (atBottom() && index < heights.length - 1) { - index++; animateScroll(index, false, true); } else { - if (Math.floor(elements[index].height() / $window.height()) > interstitialIndex) { - - // interstitialScroll(parseInt(heights[index])+($window.height()*interstitialIndex)); - interstitialScroll(Math.round(heights[index]) + ($window.height() * interstitialIndex)); + if (Math.floor(elements[index].height() / $window.windowHeight()) > interstitialIndex) { + interstitialScroll(Math.round(heights[index]) + ($window.windowHeight() * interstitialIndex)); interstitialIndex += 1; - } else { - // interstitialScroll(parseInt(heights[index])+(elements[index].height()-$window.height())); - interstitialScroll(Math.round(heights[index]) + (elements[index].height() - $window.height())); + interstitialScroll(Math.round(heights[index]) + (elements[index].height() - $window.windowHeight())); } } } }, up: function () { + if (index >= 0) { if (atTop() && index > 0) { @@ -502,8 +502,8 @@ if (interstitialIndex > 2) { interstitialIndex -= 1; - // interstitialScroll(parseInt(heights[index])+($window.height()*interstitialIndex)); - interstitialScroll(Math.round(heights[index]) + ($window.height() * interstitialIndex)); + // interstitialScroll(parseInt(heights[index])+($window.windowHeight()*interstitialIndex)); + interstitialScroll(Math.round(heights[index]) + ($window.windowHeight() * interstitialIndex)); } else { @@ -593,8 +593,8 @@ overflow[i] = false; } else { - if (($(this).css("height", "auto").outerHeight() < $window.height()) || $(this).css("overflow") === "hidden") { - $(this).css({"height": $window.height()}); + if (($(this).css("height", "auto").outerHeight() < $window.windowHeight()) || $(this).css("overflow") === "hidden") { + $(this).css({"height": $window.windowHeight()}); overflow[i] = false; } else { @@ -612,7 +612,7 @@ } else { - if (($(this).outerHeight() < $window.height()) || (settings.overflowScroll === false)) { + if (($(this).outerHeight() < $window.windowHeight()) || (settings.overflowScroll === false)) { overflow[i] = false; } else { overflow[i] = true; @@ -694,7 +694,7 @@ } top = $window.scrollTop(); - if (top < parseInt(heights[index]) + (elements[index].outerHeight() - $window.height()) - 28) { + if (top < parseInt(heights[index]) + (elements[index].outerHeight() - $window.windowHeight()) - 28) { return false; -- 2.39.5