Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to enable Fancybox to change to the adjacent gallery by simply using the 'up' or 'down' arrow keys? #691

Open
jsV8 opened this issue Sep 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jsV8
Copy link

jsV8 commented Sep 7, 2024

Describe the bug

I am currently working on a layout that consists of a vertical column of thumbnail images, each linked to its own gallery with additional images. When the user clicks on a thumbnail image, Fancybox opens, allowing them to navigate through the images within that specific gallery using the arrow keys.

You can view a demo of this setup here: http://jsfiddle.net/Q6tmq/

My question is how can I customize the functionality so that when the 'up' and 'down' arrow keys are pressed, instead of moving to the next or previous image within the current gallery, it will display the first image from the next or previous gallery?

In essence, I want users to be able to open Fancybox, navigate through all the images in all galleries present on the page without having to close Fancybox each time.

https://javascripter.space/questions/is-there-a-way-to-enable-fancybox-to-change-to-the-adjacent-gallery-by-simply-using-the-up-or-down-arrow-keys

Reproduction

<!-- GALLERY 1 -->
<li>
    <!-- THUMB -->
    <a class="fancybox" rel="gallery1" href="http://fancyapps.com/fancybox/demo/1_b.jpg">
        <img src="http://fancyapps.com/fancybox/demo/1_s.jpg" alt=""/>
    </a>

    <!-- IN-GALLERY IMAGES -->
    <div class="hidden">
        <a class="fancybox" rel="gallery1" href="http://fancyapps.com/fancybox/demo/2_b.jpg"></a>
        <a class="fancybox" rel="gallery1" href="http://fancyapps.com/fancybox/demo/3_b.jpg"></a>
    </div>
</li>

<!-- GALLERY 2 -->
<li>
    <!-- THUMB -->
    <a class="fancybox" rel="gallery2" href="http://fancyapps.com/fancybox/demo/4_b.jpg">
        <img src="http://fancyapps.com/fancybox/demo/4_s.jpg" alt=""/>
    </a>

    <!-- IN-GALLERY IMAGES -->
    <div class="hidden">
        <a class="fancybox" rel="gallery2" href="http://fancyapps.com/fancybox/demo/5_b.jpg"></a>
    </div>
</li>

$(".fancybox")
.fancybox({
    helpers : {
        title : {
            type : 'over'
        },
        overlay : {
            css : {
                'background' : 'rgba(0, 0, 0, 0.7)'
            }
        }
    }
}); 

Additional context

No response

@jsV8 jsV8 added the needs triage This issue has not been triaged by maintainers label Sep 7, 2024
@jsV8 jsV8 changed the title Is there a way to enable Fancybox to change to the adjacent gallery by simply using the 'up' or 'down' arrow keys? 1 Sep 7, 2024
@jsV8 jsV8 changed the title 1 Is there a way to enable Fancybox to change to the adjacent gallery by simply using the 'up' or 'down' arrow keys? Sep 7, 2024
@fancyapps fancyapps added enhancement New feature or request and removed needs triage This issue has not been triaged by maintainers labels Sep 9, 2024
@fancyapps
Copy link
Owner

fancyapps commented Sep 9, 2024

Hi,

Sorry, such functionality is not currently provided, as it is not clear how many users would need it. If enough people asked, it would be implemented.

I also wonder how users could know that pressing these keys would change the gallery, wouldn't they be surprised if they accidentally pressed them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants