inuyaksa / jquery.nicescroll

nicescroll plugin for jquery - scrollbars like iphone/ipad
https://nicescroll.areaaperta.com/
3.6k stars 1.67k forks source link

Provide option to show scrollbar automatically when needed #330

Closed ektemple closed 7 years ago

ektemple commented 10 years ago

Currently, the scrollbar seems to show up only after a mouse wheel event. This causes a number of problems:

1) The initial scroll wheel input doesn't (seem to?) move the scrollbar, it merely makes the bar visible. This makes the scrollbar feel a bit unresponsive. 2) You can use the arrow keys to scroll, but only after you've already brought up the bar with the scroll wheel. That's weird. 3) Users who don't use the scroll wheel will never see the bar to grab and drag it, nor can they use their arrow keys. (There are many of non-scrollwheelers out there, some of them on Macs without scrollbars on their mice, others who just never got in the habit of using their wheels.)

It would be great if the scrollbar auto-showed itself when needed, or if that's not feasible, if the scrollbar appeared when the user hovers the mouse over the scrollable content, or when he tapped an arrow key.

PlippiePlop commented 10 years ago

Ektemple: The bar should show on a mouseover of the scrollable area. not only on mousewheel. And it will only show if the area needs to be scrolled. However, once you are in the scroll area with the mouse pointer the scrollbar disapears unless you move out and in again with mousepointer.

There is an option called 'autohidemode' you can set it to false. if you want to always show the bar if its needed:

$('elem').niceScroll({'autohidemode': false});

ektemple commented 10 years ago

Ah. Looks like this is changing from a feature request to a bug report. The bar doesn't show up on mouseover for me. (I'm invoking niceScroll() on the body element in case that matters). I've tried turning autohidemode off, but it doesn't have any effect until I've brought up the bar using the scroll wheel. Mouse click and selecting text in the area to be scrolled also have no effect.

There aren't any error messages or warnings associated with this failure, so I'm not sure where to go from here.

PlippiePlop commented 10 years ago

Do you have any example of your code to preview your problem. Does it work if you attach iscroll to other elements? Remember if it has nothing to scroll it wont show.

ektemple commented 10 years ago

I don't have a boiled-down example, since I am working with Twine. But here is a link; you may need to click the continue button a few times to get a screen with enough content to scroll.

https://dl.dropboxusercontent.com/u/8434146/Twine/test.html

Thanks!