malihu / malihu-custom-scrollbar-plugin

Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
http://manos.malihu.gr/jquery-custom-content-scroller
MIT License
4.11k stars 1.51k forks source link

Keyboard and mousewheel events #152

Open gstaruk opened 10 years ago

gstaruk commented 10 years ago

Is is possible to implement the following:

1) Keyboard events - such as arrow keys and home / end / page up / page down / spacebar navigation.

2) Mousewheel middle click scrolling (press mousewheel button and move mouse up/down to scroll).

RempelOliveira commented 10 years ago

I would love these features too.

malihu commented 10 years ago

Version 3 (will release this week) will support keyboard arrows (top, right, down, left), PgUp, PgDn, Home and End keys. Keyboard events will be enabled by default.

RempelOliveira commented 10 years ago

Thanks.

haoss commented 10 years ago

Hello! When waiting for a third version, very, very much needed support for the keyboard.

malihu commented 10 years ago

I've created a version 3 branch: https://github.com/malihu/malihu-custom-scrollbar-plugin/tree/3.x Keyboard scrolling is enabled by default (no need to set any option)

gstaruk commented 10 years ago

Hi malihu,

Thanks - the keyboard support is a great addition!

But you haven't implemented the Mousewheel middle click scrolling feature.

So for example rather than using the mouse wheel to scroll a long container, I prefer to press the wheel and move the mouse down - it's a lot quicker.

Would that be easy enough to implement?

Flexter commented 9 years ago

Hi malihu.

The Keyboard navigator is really good option, but i noticed when the plugin is loaded in some "div" container, needs to click inside the "div" or over the page first before to use key buttons. Is it some way to fix this problem avoiding mouse click ?

malihu commented 9 years ago

Hello Flexter,

This is not really a problem or a script bug. This is the intended behavior as the custom scrollbar replicates the same functionality as browser's native scrollbar. With browser's default scrollbar you also need to click inside the overflowed element to gain focus and be able to use the keyboard.

You could add an extra script in your page to do it without clicking but in the vast majority of cases this would not be user-friendly. Do you want me to post such script example?

Flexter commented 9 years ago

Hello. I'll be so appreciated if you post Java Script example because i tried with auto click over the scrolling "div" and the result was the same. Thanks !

fayshiro commented 8 years ago

Any plans on the middle mouse button thingie? Not asking for an ETA (if you have one that's even better of course) just about intentions of ever adding that.

I noticed that aside from not having the middle-click scrolling support, I cannot ctrl+scroll to zoom in and out if the div in focus has this plugin active. It will ignore ctrl and simply scroll the div up/down. (Tried it in Firefox and Chrome so far.)

Also that if cursor is above the actual scrollbar, one cannot use mouse scroll to scroll. Wow, that wasn't complicated at all...

"By the way", thanks a ton for the plugin, really useful.

bravebox commented 8 years ago

@Flexter @malihu I have a application which has multiple list on a single page which hold many records, I use the plugin for smooth scrolling (it works great thanks for the plugin) but it would be great if the cursor key functionality would become 'active' when your mouse hovers over the list (like the mousewheel scrolling is right now). Is this doable? Thanks!