igorlino / elevatezoom-plus

Enhanced elevateZoom - A jQuery image zoom plugin
http://igorlino.github.io/elevatezoom-plus/
MIT License
163 stars 78 forks source link

Keyboard Support For Galleries #60

Open bryananthonylewis opened 8 years ago

bryananthonylewis commented 8 years ago

Is it possible to use the arrows (forwards and backwards on keyboard) to navigation the gallery images when Elevate Zoom has a gallery enabled? I know that when you enable the lightbox it works but it does NOT work otherwise. Support for both would be amazing!

igorlino commented 8 years ago

lightbox is an external/speparate/independent UI component that covers the complete page, so its easy to have global or local handlers for keyboard events.

For an embedded gallery, global handlers could potentially clash with other components, so probably not the best thing to implement out of the box. Probably the implementation would require, on top of enabling the gallery, enabling explicit keyboard navigation for the gallery.

ATM I don't have any time since several months.

It does not seems complicate to do, maybe you would like to give it a try ? It would involve:

  1. Extend elevate zoom configuration for explicit gallery keyboard navigation
  2. Register global keyboard event handlers (left and right arrows) when the respective setting has been enabled. The handlers should use good namespace name.
  3. Implement the moving of left and right, the actual event handler implementation.
  4. When destroying the plugin, the handlers should also be removed. Easy to do if the handler had a good namespace.