fancyapps / fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.
http://fancyapps.com/
7.28k stars 1.78k forks source link

Mapping up/down keys to scrolling for images? #1427

Open conwayanderson opened 7 years ago

conwayanderson commented 7 years ago

What would be the cleanest way to enable using the up and down keys for scrolling for images? I notice that the source JS has a switch which maps the up and down keys to navigation. After looking at the docs, I didn't notice an option for changing this. Second to that, an option to just turn on standard scrolling could work.

fancyapps commented 7 years ago

Hi,

What do mean by "enable using the up and down keys for scrolling for images"? Up/down keys are navigating gallery by default.

conwayanderson commented 7 years ago

Yes - I want to use them for scrolling, as is the default on desktops, not navigation.

fancyapps commented 7 years ago

But what do you mean by "scrolling" ? You mean - panning when zoomed in?

conwayanderson commented 7 years ago

Yes

fancyapps commented 7 years ago

Hmm, good point. I`ll implement this along with mouse scrolling.

conwayanderson commented 7 years ago

Great, looking forward to that and thanks for creating this btw. In the meantime, would you suggest changing the JS file directly to have the keycode switch do something like scrollBy(x,y)?

conwayanderson commented 7 years ago

Not sure if scrollBy works when in the zoomed view

fancyapps commented 7 years ago

That is the problem, such method (like scrollBy) is not available. You could, for example, check if zoomed in using "canPan()" and then update image wrapper position manually.

conwayanderson commented 7 years ago

Hmm, okay. I'll have to dig a little deeper.

On Thu, May 11, 2017 at 12:39 AM Jānis Skarnelis notifications@github.com wrote:

That is the problem, such method (like scrollBy) is not available. You could, for example, check if zoomed in using "canPan()" and then update image wrapper position manually.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fancyapps/fancybox/issues/1427#issuecomment-300708467, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy5R2WOnXsErPUF39V0T0FbLHDDBWSEks5r4rscgaJpZM4NXjcV .

-- Sent from Gmail Mobile

babajem commented 7 years ago

I think I have the same problem. When my modal opens, users want to scroll down inside the modal with keys up/down. I thought adding "keyboard:false" in the options would do the trick but no :D

The best would be to have the possibility to slide from modal 1 to modal 2 with keys left/right and leave the default behaviour of keys up/down for scrolling inside the content of the modal. It would be perfect :)