buzinas / simple-scrollbar

Very simple and lightweight vanilla javascript library for creating a custom scrollbar cross-browser.
MIT License
575 stars 159 forks source link

So is this thing mobile friendly? #6

Closed ghost closed 8 years ago

ghost commented 8 years ago

Will touch gestures make the scrollbar move or will it ignore touch untill I use hammer or some other library? I am not sure if we understand the same thing with the word native.

*edit: Your use of mousedown, mouseup and mousemove would suggest it is. I just don't want this to be too good to be true

buzinas commented 8 years ago

It works with mobile touches exactly the same way as native scrollbars do. Em 05/06/2016 13:30, "Puddingboy" notifications@github.com escreveu:

Will touch gestures make the scrollbar move or will it ignore touch untill I use hammer or some other library? I am not sure if we understand the same thing with the word native.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/buzinas/simple-scrollbar/issues/6, or mute the thread https://github.com/notifications/unsubscribe/AG9ehzRIoO4uCKFJtWSyD2P53Sb0Eq0gks5qIvmLgaJpZM4IuY_s .

ghost commented 8 years ago

Roger that. I did test it with my phone on your demo, but I did notice that the body background scrolled aswell. I suppose I would have to block background scrolling somehow. Do you have any ideas to make this work? So while simple-scrollbar is scrolling other content is blocked from scrolling?

buzinas commented 8 years ago

If you want that behavior, you can put the following css rule there:

body {
  overflow: hidden;
}

Em 05/06/2016 15:40, "Puddingboy" notifications@github.com escreveu:

Roger that. I did test it with my phone on your demo, but I did notice that the body background scrolled aswell. I suppose I would have to block background scrolling somehow. Do you have any ideas to make this work? So while simple-scrollbar is scrolling other content is blocked from scrolling?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/buzinas/simple-scrollbar/issues/6#issuecomment-223829526, or mute the thread https://github.com/notifications/unsubscribe/AG9eh70pus1bKDyhV_K9HeuIE-XzDmXaks5qIxgagaJpZM4IuY_s .

ghost commented 8 years ago

I think I like that approach. I found a different suggestion that blocks the event using javascript, but I think using js to change the overflow property temporary may be a an even better idea.

*edit: won't that make the page move a little in the process of changing this property?

ghost commented 8 years ago

Oh I'm not sure if it was clear from my last comment but what I meant was that if you have a page with a regular scrollbar and you put the overflow on hidden, the scrollbar disappears and the x offset of the page may jump a little.