From f7f9fbdb883fc1eaff0212dd6b6c46b11dd8e788 Mon Sep 17 00:00:00 2001 From: Hamid Fathi Date: Mon, 24 Sep 2018 12:10:21 +0330 Subject: [PATCH] Update scrollIt.js Default Index for the specific anchor in the page. It will be useful for redirecting from another page to a specific position. --- scrollIt.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scrollIt.js b/scrollIt.js index 2985271..d90859e 100644 --- a/scrollIt.js +++ b/scrollIt.js @@ -22,7 +22,8 @@ scrollTime: 600, activeClass: 'active', onPageChange: null, - topOffset : 0 + topOffset : 0, + defaultIndex : 0 }; $.scrollIt = function(options) { @@ -124,6 +125,7 @@ e.preventDefault(); doScroll(e); }); - + if (options.defaultIndex > 0) + navigate(options.defaultIndex); }; }(jQuery));