From 4cfe27956411bc1394d8225a0fd98769556b3f8e Mon Sep 17 00:00:00 2001 From: Chris O'Brien Date: Wed, 11 Jan 2017 09:40:32 -0500 Subject: [PATCH 1/2] Add files via upload Add key press functionality for 'Home' and 'End' --- jquery.scrollify.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/jquery.scrollify.js b/jquery.scrollify.js index e3377ac..a72f7a3 100644 --- a/jquery.scrollify.js +++ b/jquery.scrollify.js @@ -342,7 +342,7 @@ if touchScroll is false - update index } if(e.keyCode==38 || e.keyCode==33) { if(index>0) { - if(atTop()) { + if (atTop()) { e.preventDefault(); index--; //index, instant, callbacks, toTop @@ -351,13 +351,31 @@ if touchScroll is false - update index } } else if(e.keyCode==40 || e.keyCode==34) { if(index 0) { + if (atTop()) { + e.preventDefault(); + index = 0; + //index, instant, callbacks, toTop + animateScroll(index, true, true, false); + } + } + } else if (e.keyCode==35) { + if (index < heights.length - 1) { + if (atBottom()) { + e.preventDefault(); + index = heights.length - 1; + //index, instant, callbacks, toTop + animateScroll(index, true, true, false); + } + } } }, init:function() { From f7ec384d94f4124cee6068b0481dd80e8a50d408 Mon Sep 17 00:00:00 2001 From: Chris O'Brien Date: Wed, 11 Jan 2017 09:42:34 -0500 Subject: [PATCH 2/2] Add files via upload Add key press functionality for 'Home' and 'End' --- jquery.scrollify.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jquery.scrollify.js b/jquery.scrollify.js index a72f7a3..3751cd0 100644 --- a/jquery.scrollify.js +++ b/jquery.scrollify.js @@ -342,7 +342,7 @@ if touchScroll is false - update index } if(e.keyCode==38 || e.keyCode==33) { if(index>0) { - if (atTop()) { + if(atTop()) { e.preventDefault(); index--; //index, instant, callbacks, toTop @@ -351,14 +351,14 @@ if touchScroll is false - update index } } else if(e.keyCode==40 || e.keyCode==34) { if(index 0) { if (atTop()) { e.preventDefault(); @@ -367,7 +367,7 @@ if touchScroll is false - update index animateScroll(index, true, true, false); } } - } else if (e.keyCode==35) { + } else if (e.keyCode == 35) { if (index < heights.length - 1) { if (atBottom()) { e.preventDefault();