You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your job on dragScroll.js.
This is exactly what I was looking for. 👍
I have a suggestion. According to my needs, I wanted to drag and scroll a large table element with multiple columns. These columns have inputs or button for making the table filterable or editable...
So I modified your plugin to add parameters to prevent scrolling by including/excluding a specific list of objects.
So line 23, I added options:
handle: null, // is or not (below selector)
selector: null // selectors
Line 81 (mousedown event) :
// Default drag is possible
var isDraggable = true;
var objTarget = $(e.target);
// Prevent dragging with unwanted selector
if (_handle == 'is' && !objTarget.is(_selector)) isDraggable = false;
// Prevent dragging with unwanted selector
if (_handle == 'not' && objTarget.is(_selector)) isDraggable = false;
// Is is draggable?
if (isDraggable) { ... [All mousedown code] ... }
Usage for dragging only with td or div with class Unicorn:
$('.myDraggableItem').dragScroll({
direction: 'scrollLeft',
handle: 'is',
selector: 'td, div.Unicorn'
});
With that all other elements such as editable input are still usable because they are not locked by dragScroll functionnality.
Extra, in mousemove event to have a "move" cursor when dragging:
$this.css('cursor', 'move');
And so, in mouseup mouseleave event, to set back default cursor:
$this.css('cursor', 'default');
I hope you understood this and that it will help improving your work.
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for your job on dragScroll.js.
This is exactly what I was looking for. 👍
I have a suggestion. According to my needs, I wanted to drag and scroll a large table element with multiple columns. These columns have inputs or button for making the table filterable or editable...
So I modified your plugin to add parameters to prevent scrolling by including/excluding a specific list of objects.
So line 23, I added options:
Line 81 (mousedown event) :
With that all other elements such as editable input are still usable because they are not locked by dragScroll functionnality.
Extra, in mousemove event to have a "move" cursor when dragging:
And so, in mouseup mouseleave event, to set back default cursor:
I hope you understood this and that it will help improving your work.
Thanks
The text was updated successfully, but these errors were encountered: