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

Init from DOM demo - access to the PhotoSwipe instance(s) limited #1540

Open
heyflo opened this issue Jul 17, 2018 · 0 comments
Open

Init from DOM demo - access to the PhotoSwipe instance(s) limited #1540

heyflo opened this issue Jul 17, 2018 · 0 comments

Comments

@heyflo
Copy link

heyflo commented Jul 17, 2018

I am willing to sync the PhotoSwipe gallery to the Swiper slider which has the images I'm clicking onto to open the PhotoSwipe gallery.

But as I have to use the DOM init in the demo/doc (http://photoswipe.com/documentation/getting-started.html - the "How to build an array of slides from a list of links" part), I'm having a real hard time to figure out how to have access to the PhotoSwipe instance to get the current index of the slide (for example) as shown in the API documentation with pswp.getCurrentIndex(); where pspw is the current instance initialized with var pswp = new PhotoSwipe( /* ... */ );.

Both libraries have to communicate so having everything scoped into the initPhotoSwipeFromDOM won't help.

I'm trying to find some help to not entirely rewrite it but tweak the current given code instead.

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

1 participant