Codeinwp / Ideal-Image-Slider-JS

Quite simply the ideal Image Slider in vanilla JS.
http://idealimageslider.com
GNU General Public License v3.0
1.57k stars 160 forks source link

Keyboard support #16

Closed the0neyouseek closed 10 years ago

the0neyouseek commented 10 years ago

Keyboard arrow support would be nice :smile:

gilbitron commented 10 years ago

Agreed.

the0neyouseek commented 10 years ago

Don't know if that helps but here's some basic implementation:

document.onkeydown = function (e) {
  e = e || window.event;
  var button = (typeof e.which == "number") ? e.which : e.keyCode;

  if (button == 37) {
    // previous
  } else if (button == 39) {
    // next
  }
};
gilbitron commented 10 years ago

I've implemented this in v1.1.0