Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions jquery.dnd_page_scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<div id="top_scroll_page">&nbsp;</div>').appendTo('body');
top_el = $('<div id="'+options.topId+'">&nbsp;</div>').appendTo('body');

var bottom_el = $('#'+options.bottomId);
if (!bottom_el.length)
bottom_el = $('<div id="bottom_scroll_page">&nbsp;</div>').appendTo('body');
bottom_el = $('<div id="'+options.bottomId+'">&nbsp;</div>').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',
Expand Down Expand Up @@ -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},
Expand Down