Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Up and down buttons in vertical mode #568

Closed
wants to merge 1 commit into from

3 participants

@stesmi99

Change of keyup event so that up and down keys in vertical mode take place of what left and right do in horizontal mode. A fairly simple and hopefully valid minor improvement to what is already an awesome plug-in.

@stesmi99 stesmi99 Update jquery.flexslider.js
Change of keyup event so that up and down keys in vertical mode take place of what left and right do in horizontal mode.
2718ea8
@foaly-nr1

thanks!

@mattyza
Owner

@stesmi99 Our sincerest apologies for the delay in getting back to you on this.

While this looks and works great, there is a usability concern when the page itself is taller than the viewport. When using the up and down arrow keys to navigate, the page itself scrolls as well.

While I don't think this will make it into version 2.2.0, any further assistance would be very much appreciated, if time allows.

Please do submit a new pull request if you find some time to explore this further. We welcome contributions. :)

@mattyza mattyza closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 26, 2013
  1. @stesmi99

    Update jquery.flexslider.js

    stesmi99 authored
    Change of keyup event so that up and down keys in vertical mode take place of what left and right do in horizontal mode.
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 4 deletions.
  1. +15 −4 jquery.flexslider.js
View
19 jquery.flexslider.js
@@ -89,10 +89,21 @@
if (vars.keyboard && ($(slider.containerSelector).length === 1 || vars.multipleKeyboard)) {
$(document).bind('keyup', function(event) {
var keycode = event.keyCode;
- if (!slider.animating && (keycode === 39 || keycode === 37)) {
- var target = (keycode === 39) ? slider.getTarget('next') :
- (keycode === 37) ? slider.getTarget('prev') : false;
- slider.flexAnimate(target, vars.pauseOnAction);
+ if (vars.direction === 'vertical')
+ {
+ if (!slider.animating && (keycode === 40 || keycode === 38)) {
+ var target = (keycode === 40) ? slider.getTarget('next') :
+ (keycode === 38) ? slider.getTarget('prev') : false;
+ slider.flexAnimate(target, vars.pauseOnAction);
+ }
+ }
+ else
+ {
+ if (!slider.animating && (keycode === 39 || keycode === 37)) {
+ var target = (keycode === 39) ? slider.getTarget('next') :
+ (keycode === 37) ? slider.getTarget('prev') : false;
+ slider.flexAnimate(target, vars.pauseOnAction);
+ }
}
});
}
Something went wrong with that request. Please try again.