asvd / dragscroll

micro library for drag-n-drop scrolling style
http://asvd.github.io/dragscroll/
MIT License
1.09k stars 168 forks source link

Drag by a specific amount #29

Open hkutcher opened 7 years ago

hkutcher commented 7 years ago

Great tool. :-) Would you consider adding a parameter or setting to allow scrolling by a specific amount? The area I'm scrolling has columns of info and I'd like to "snap to column", that is, force scrolling by whole columns, not fractions of a column. My columns are 240px, so I was doing this like $(".scroller").scrollLeft(parseInt(this.scrollLeft / 240) * 240);. This no longer works when I add .dragscroll.

asvd commented 7 years ago

What is the exact issue:

hkutcher commented 7 years ago

Both. Yes, my code no longer works, because dragscroll overrides it. I would like dragscroll to go to the next logical increment, round up or down in increments of the column width, which is 240px, however, ideally col width/increment/snap to amount would be configurable.