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

Paginated images doesn't open in external lightboxes #149

Closed
Sidelity opened this issue Jan 31, 2021 · 4 comments
Closed

Paginated images doesn't open in external lightboxes #149

Sidelity opened this issue Jan 31, 2021 · 4 comments

Comments

@Sidelity
Copy link

When using "Images" as content source, any kind of pagination, and "URL" as Item click action, only the first images that are loaded are opened in external lightboxes. All images that are loaded via pagination simply navigates to the source image when clicked on.

This seems to occur regardless of what external lightbox you use. The built-in popup lightbox does not have this problem. If you set Items Per Page to "All Items", all images open correctly.

@nk-o
Copy link
Collaborator

nk-o commented Feb 8, 2021

Hey.

How this is related to our plugin? If 3rd-party lightboxes don't support AJAX loaded content, this is no our plugin problem.

@nk-o nk-o closed this as completed Feb 8, 2021
@Sidelity
Copy link
Author

If you've confirmed that it's a 3rd party issue, then fine. However, I've tried using 3 very popular WP lightbox plugins (Simple Lightbox, Responsive Lightbox & Gallery, WP Featherlight), none of which work. I'd assume that the top lightboxes would support AJAX loading.

WP Featherlight specifically mentions supporting AJAX content "by adding data attributes to your content". I've confirmed that only the first loaded images get the correct data-featherlight="image" attribute, while the paginated images do not. Now, I'm too much of a rookie to be able to say who's to blame here, if it's the lightbox plugin that fails to add attributes, or if it's Visual Portfolio that forgets to notify Wordpress or whatever that new content has been added. I'm sure you know best.

A suggestion would be to maybe allow the user to add custom attributes? Like how you allows the user to add a "Rel" attribute?

@nk-o
Copy link
Collaborator

nk-o commented Feb 17, 2021

@Kartug01 some of these plugins support manual initialization methods, that you can use after AJAX loaded by our plugin. I don't see any reason why we should make an integration with plugins, that our plugin does not need. Since we have built-in lightbox features, these plugins are redundant.

If you still want to use these plugins, you will need to manually add scripts. Our jQuery event endLoadingNewItems.vpf may help with it https://visualportfolio.co/documentation/developers/jquery-events/

@Sidelity
Copy link
Author

Thanks for pointing me in the right direction. You were absolutely right, I was able to trigger the lightbox by entering a custom jQuery event in the lightbox plugin. My bad!

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

No branches or pull requests

2 participants