Browse Source

Merge pull request #33 from seanhellwig/master

Fix for Enhancement issue #3 - add left and right key navigation bindings
pull/35/head
Zach Wise 13 years ago
parent
commit
06926ed403
  1. 15
      source/js/VMM.Core.js
  2. 15
      timeline-min.js
  3. 15
      timeline.js

15
source/js/VMM.Core.js

@ -355,6 +355,20 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
}
function onKeypressNav(e) {
switch(e.keyCode) {
//right arrow
case 39:
onNextClick(e);
break;
//left arrow
case 37:
onPrevClick(e);
break;
}
}
function onTouchUpdate(e, b) {
if (slide_positions.length == 0) {
for(var i = 0; i < slides.length; i++) {
@ -590,6 +604,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.bindEvent(".nav-next", onNextClick);
VMM.bindEvent(".nav-previous", onPrevClick);
VMM.bindEvent(window, onKeypressNav, 'keydown');
}
/* BUILD

15
timeline-min.js vendored

File diff suppressed because one or more lines are too long

15
timeline.js

@ -2713,6 +2713,20 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
}
function onKeypressNav(e) {
switch(e.keyCode) {
//right arrow
case 39:
onNextClick(e);
break;
//left arrow
case 37:
onPrevClick(e);
break;
}
}
function onTouchUpdate(e, b) {
if (slide_positions.length == 0) {
for(var i = 0; i < slides.length; i++) {
@ -2948,6 +2962,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.bindEvent(".nav-next", onNextClick);
VMM.bindEvent(".nav-previous", onPrevClick);
VMM.bindEvent(window, onKeypressNav, 'keydown');
}
/* BUILD

Loading…
Cancel
Save