asvd / dragscroll

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

normalize style, simplify naming && stop drag on mouseout #2

Closed dustinhayes closed 9 years ago

dustinhayes commented 9 years ago

This is really two separate requests. I can break apart if need be.

asvd commented 9 years ago

Thanks for the contribution! Regretably I cannot merge it exactly like this:

  1. On stopping dragging on mosueout: I don't like the idea and consider this as being less convenient. But still this is an interesting topic to discuss. You can create a demo with two scrollable elements side by side, one will continue dragging on mouse out, and other will not. Therefore we will be able to touch and compare what is actually more convenient.
  2. On coding style: actually most of those are pretty minor. Please read my inline comments. I can merge your pull-request in case you take them into consideration.
dustinhayes commented 9 years ago

Cool, I'll put together a demo of the mouseout functionality. Please see my comment about caching the collection length for loops that iterate over HTMLCollections. It's upwards of 65% faster, and that's in modern browsers.