Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions jquery.onepage-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,16 @@

if (!$("body").hasClass("disabled-onepage-scroll")) {
switch(e.which) {
case 38:
case 38: //up
if (tag != 'input' && tag != 'textarea') el.moveUp()
break;
case 40:
case 40: //down
if (tag != 'input' && tag != 'textarea') el.moveDown()
break;
case 37: //left
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting disabling up/down when the scroll is horizontal.

            case 37:
              if (tag != 'input' && tag != 'textarea' && settings.direction === 'horizontal') el.moveUp()
            break;
            case 39:
              if (tag != 'input' && tag != 'textarea' && settings.direction === 'horizontal') el.moveDown()
            break;
            case 38:
              if (tag != 'input' && tag != 'textarea' && settings.direction === 'vertical') el.moveUp()
            break;
            case 40:
              if (tag != 'input' && tag != 'textarea' && settings.direction === 'vertical') el.moveDown()
            break;

if (tag != 'input' && tag != 'textarea') el.moveUp()
break;
case 39: //right
if (tag != 'input' && tag != 'textarea') el.moveDown()
break;
case 32: //spacebar
Expand Down