From 61fc290fce2dbf48a655a7ad06bb6369c4c5af88 Mon Sep 17 00:00:00 2001 From: Ibnelaiq <58213692+Ibnelaiq@users.noreply.github.com> Date: Sun, 31 May 2020 16:14:19 +0500 Subject: [PATCH 1/2] Add the getCurrentSection function. Addition of getCurrentSection() for getting on which section user is currently on. --- jquery.onepage-scroll.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jquery.onepage-scroll.js b/jquery.onepage-scroll.js index 71c75ba..8e904cb 100644 --- a/jquery.onepage-scroll.js +++ b/jquery.onepage-scroll.js @@ -210,7 +210,10 @@ } el.transformPage(settings, pos, page_index); } - } + $.fn.getCurrentSection = function(){ + current = $(settings.sectionContainer + ".active"); + return current.attr("data-index"); + } function responsive() { //start modification From e63502d0cb07442acd36470e2af8f1b4aa2e19ac Mon Sep 17 00:00:00 2001 From: Ibnelaiq <58213692+Ibnelaiq@users.noreply.github.com> Date: Sun, 31 May 2020 16:16:10 +0500 Subject: [PATCH 2/2] Update jquery.onepage-scroll.js --- jquery.onepage-scroll.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.onepage-scroll.js b/jquery.onepage-scroll.js index 8e904cb..f88fdd4 100644 --- a/jquery.onepage-scroll.js +++ b/jquery.onepage-scroll.js @@ -210,10 +210,11 @@ } el.transformPage(settings, pos, page_index); } - $.fn.getCurrentSection = function(){ + } + $.fn.getCurrentSection = function(){ current = $(settings.sectionContainer + ".active"); return current.attr("data-index"); - } + } function responsive() { //start modification