diff --git a/jquery.dnd_page_scroll.js b/jquery.dnd_page_scroll.js index fc38f3e..22e2f2e 100644 --- a/jquery.dnd_page_scroll.js +++ b/jquery.dnd_page_scroll.js @@ -11,19 +11,20 @@ topId: 'top_scroll_page', bottomId: 'bottom_scroll_page', delay: 50, - height: 20 + height: 20, + scrollBy: 50, }; var options = $.extend(defaults, options); 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', @@ -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},