From 4a42ba993730fd80c99f83dbc4ed761ddf62da79 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 4 Sep 2018 12:52:34 +0200 Subject: Fixed typeError caused by scrolling overflow in first page --- assets/js/fullpage.js | 17 ++++++++++------- assets/js/main.js | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'assets') diff --git a/assets/js/fullpage.js b/assets/js/fullpage.js index c499a4c..86b95bb 100644 --- a/assets/js/fullpage.js +++ b/assets/js/fullpage.js @@ -279,8 +279,6 @@ if (settings.useSlideNumbers) { if (fadeInOut) { $('#' + settings.slideNumbersContainer).fadeIn(); - } else { - $('#' + settings.slideNumbersContainer).fadeOut(); } } } @@ -521,11 +519,16 @@ * ============================================================================ */ $.fn.scrollTo = function (element) { if (element !== last) { - $("body,html").stop(true, true).animate({ - scrollTop: $(element).offset().top - }, { - duration: 375 - }); + try { + $("body,html").stop(true, true).animate({ + scrollTop: $(element).offset().top + }, { + duration: 375 + }); + } catch (e) { + $(".paginate:first").click(); + } + } else { $("body,html").stop(true, true).animate({ scrollTop: $(document).outerHeight() - windowHeight diff --git a/assets/js/main.js b/assets/js/main.js index 5e06d0d..8c21b21 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -7,6 +7,5 @@ $(document).ready(() => { slideNumbersColor: 'transparent', bodyContainer: 'pageWrapper', }); - $(".ScrollDown").click(() => $(".paginate:nth-of-type(2n)").click()); }); \ No newline at end of file -- cgit v1.2.3