Can I hide the scroll bars, but continue to overflow?

I want to create a custom horizontal scrollbar so that all OSs display it the same way, without ugly window scrollbars.

I know how to make one through JS with some sort of list combining at the top, but I need to hide the default scrollbars, but leave the overflow so that I can detect the onscroll event (so there are gestures on the OSX touchpad, mousewheeel, etc. all are handled for me and trigger the onscroll callback).

Ideas?

+4
source share
3 answers

You must manage yourself. IOS devices do not trigger scroll events, such as a desktop browser. You have a scroll event only at the end of a touch. If you want to track the entire scroll sequence, you need to track the touch screen / touchmove / touchhend (and touchcancel).

http://developer.apple.com/library/IOs/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

0
source

Take a look at these examples: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

Not sure if the onscroll event is fired, never tried. If not, the mousewheel plugin is included, probably giving you some callbacks to handle what you want ...

0
source

overflow:hidden should do what you want; it can still scroll programmatically.

0
source

Source: https://habr.com/ru/post/1385675/


All Articles