News for hackers. Stuff that matters.
Re:Dragscroll – a tiny JS library which enables scrolling vi... by atesti on Sunday March 22, 2015 @06:08PM (#9248458)
Even before having a mouse with wheel I used to scroll stuff with by dragging: I just selected text and when the selection reached the border, it started to scroll. I bet I'm not the only one. Anybody considering disabling selection or showing social media tools after selecting text should consider such weird behaviour.

Nowadays I use my Thinkpad without Synaptics or trackpoint drivers and the middle button works perfectly: Either using it open links in new tabs, or pressing it to start scroll mode. Now the mouse pointer changes and moving it scrolls. Unfortunately some software breaks this, probably WPF

Re:Dragscroll – a tiny JS library which enables scrolling vi... by joeframbach on Monday March 23, 2015 @09:11AM (#9250650)
Relevant xkcd: https://xkcd.com/1172/
Re:Dragscroll – a tiny JS library which enables scrolling vi... by ams6110 on Sunday March 22, 2015 @04:09PM (#9248035)
Tangentially, what's a good JS library to implement drag/drop on mobile?

I'm thinking of one site in particular that implements prioritizing choices by drag/dropping them into order of preference. But when you try to use the site on a mobile browser, it just scrolls the page when you try to drag an item.

I'd like to suggest to them how to fix it, rather than just complain.

Re:Dragscroll – a tiny JS library which enables scrolling vi... by jewel on Sunday March 22, 2015 @05:29PM (#9248331)
If they are using jquery UI, then there is a small fix addon called "touch punch" which repairs it.

A similar approach should work for other libraries. You need to handle the "touch" events in addition to "mousedown" and "mouseup".

Re:Dragscroll – a tiny JS library which enables scrolling vi... by huskyr on Sunday March 22, 2015 @06:42PM (#9248567)
Check out Hammer.JS: http://hammerjs.github.io/
Re:Dragscroll – a tiny JS library which enables scrolling vi... by WhitneyLand on Sunday March 22, 2015 @03:18PM (#9247880)
It's a nice idea, but could it be made to be mobile friendly? For example when touch scrolling on a device the text scrolls in a choppy fashion rather than smooth with momentum.

I understand this is for desktop, but it would be nice if it could not get in the way of what div/overflow gives us for free.

Re:Dragscroll – a tiny JS library which enables scrolling vi... by xpostman on Sunday March 22, 2015 @03:58PM (#9248001)
Sorry, I think I don't clearly get what you mean. Tablets normally scroll smoothly pixel-wise as long as you move the finger. In fact, dragscroll implements the similar behaviour for desktops, because I consider such behaviour as more reasonable in many cases (comparing to selecting the content of the area, I mean).
Re:Dragscroll – a tiny JS library which enables scrolling vi... by WhitneyLand on Sunday March 22, 2015 @04:15PM (#9248051)
You are right about how tablets are supposed to work.

The problem is that in your examples this behavior no longer functions as expected on tablets.

The example should work well for both desktop and tablet. Your current implementation changes the normal behavior on tablets.

Re:Dragscroll – a tiny JS library which enables scrolling vi... by xpostman on Sunday March 22, 2015 @05:26PM (#9248324)
There probaby an bug in dragscroll then. It is not supposed to break the behaviour on tablets, will test it..
Re:Dragscroll – a tiny JS library which enables scrolling vi... by unicornporn on Monday March 23, 2015 @04:59AM (#9249990)
The problem with solutions like these: without a notice, how will the user ever know that they can drag scroll on my site? Perhaps for a web app with a limited user base that can be educated...
Re:Dragscroll – a tiny JS library which enables scrolling vi... by mobiuscog on Monday March 23, 2015 @05:06AM (#9249999)
The cursor changes. Admittedly, if people aren't capable of noticing that, they may be a lost cause.
Re:Dragscroll – a tiny JS library which enables scrolling vi... by contradictioned on Monday March 23, 2015 @07:54AM (#9250402)
True for images, but not for the text (chromium+linux). And I get annoyed when I cant select text.
Re:Dragscroll – a tiny JS library which enables scrolling vi... by xpostman on Monday March 23, 2015 @11:55AM (#9251537)
This is defined by the developer actually. And besides there is no problem for a user if he does not know that he can scroll with dragging.
Re:Dragscroll – a tiny JS library which enables scrolling vi... by 1and2equals0 on Sunday March 22, 2015 @06:04PM (#9248440)
I also like the idea. Would be cool if it could work naturally with pointer lock - annoying to have to reset pointer position manually :)
Re:Dragscroll – a tiny JS library which enables scrolling vi... by xpostman on Sunday March 22, 2015 @07:21PM (#9248674)
then you will have to manually reset the mouse on the table :-D
Re:Dragscroll – a tiny JS library which enables scrolling vi... by glxybstr on Sunday March 22, 2015 @04:50PM (#9248168)
sort of interesting. i expected it to have velocity/inertia, but I think that would make it much more than ~900 bytes
Re:Dragscroll – a tiny JS library which enables scrolling vi... by nfoz on Sunday March 22, 2015 @05:37PM (#9248359)
Why shouldn't this be up to the mouse driver? I used to just use middle-click for this.
Re:Dragscroll – a tiny JS library which enables scrolling vi... by adrusi on Sunday March 22, 2015 @09:47PM (#9249064)
Because sometimes there are scrollable areas on the page that you want to pan, not scroll, but there's no panning built into HTML. Yes, mouse drivers should make it possible to pan any scrollable area, but most don't, and websites have to be usable with shitty drivers.
Re:Dragscroll – a tiny JS library which enables scrolling vi... by supercoder on Sunday March 22, 2015 @05:55PM (#9248412)
I've been using ftscroller which is great for emulating UIScrollView
Re:Dragscroll – a tiny JS library which enables scrolling vi... by whoisthemachine on Sunday March 22, 2015 @06:10PM (#9248463)
Nifty