From cb483ec592518f785a8bffac7492067679456dc4 Mon Sep 17 00:00:00 2001 From: John Gale Date: Thu, 14 Feb 2019 15:46:56 +0000 Subject: [PATCH 1/2] fix bug with configurable ids --- jquery.dnd_page_scroll.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.dnd_page_scroll.js b/jquery.dnd_page_scroll.js index fc38f3e..b76471d 100644 --- a/jquery.dnd_page_scroll.js +++ b/jquery.dnd_page_scroll.js @@ -17,13 +17,13 @@ var top_el = $('#'+options.topId); if (!top_el.length) - top_el = $('
 
').appendTo('body'); + top_el = $('
 
').appendTo('body'); var bottom_el = $('#'+options.bottomId); if (!bottom_el.length) - bottom_el = $('
 
').appendTo('body'); + bottom_el = $('
 
').appendTo('body'); - var both_el = $('#top_scroll_page, #bottom_scroll_page'); + var both_el = $('#'+options.topId+', #'+options.bottomId); both_el.hide(); both_el.css({ //backgroundColor: '#FFE698', From 9365e87ef217d112e771ff0d72b1c4fda441b035 Mon Sep 17 00:00:00 2001 From: John Gale Date: Thu, 14 Feb 2019 15:47:27 +0000 Subject: [PATCH 2/2] add new option to allow the scroll amount to be altered. --- jquery.dnd_page_scroll.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.dnd_page_scroll.js b/jquery.dnd_page_scroll.js index b76471d..22e2f2e 100644 --- a/jquery.dnd_page_scroll.js +++ b/jquery.dnd_page_scroll.js @@ -11,7 +11,8 @@ topId: 'top_scroll_page', bottomId: 'bottom_scroll_page', delay: 50, - height: 20 + height: 20, + scrollBy: 50, }; var options = $.extend(defaults, options); @@ -52,7 +53,7 @@ //console.log('dragover '+direction+' last='+last+' current='+current); if (last != undefined && last == current && current > 0) { - var newScrollTop = scrollTop+direction*50; + var newScrollTop = scrollTop+direction*options.scrollBy; //console.log('scrolling '+newScrollTop); $('html,body').animate( {scrollTop: newScrollTop},