Question

I want to keep my scroll bar and off its scrolling only on Arrow..

I tried to insert it to div overflow: scroll and then to second div overflow: hidden inside first..
but it doesn't work

*Any idea? *

Was it helpful?

Solution

If you want to prevent scrolling with arrows,

// add keyboard events
                    $( document ).keydown( function(e) {
                        var keyCode = e.keyCode || e.which,
                            arrow = {
                                left : 37,
                                up : 38,
                                right : 39,
                                down : 40,
                                escape : 27
                            };

                        switch (keyCode) {
                            case arrow.up:
                                e.preventDefault();
                                }
                           case arrow.down:
                                e.preventDefault();
                                }
                                break;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top