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

How to change the PhotoSwipe's items dynamically ? #1041

Closed
SimonWang2014 opened this issue Dec 11, 2015 · 2 comments
Closed

How to change the PhotoSwipe's items dynamically ? #1041

SimonWang2014 opened this issue Dec 11, 2015 · 2 comments

Comments

@SimonWang2014
Copy link

I have some DIV in my html, everytime i click the images in the different div , how can i change the images dynamically ?
I tried to change the items , but errored:

Cannot assign to read only property 'initialLayout' of false
@dimsemenov
Copy link
Owner

There is a section at the bottom of API documentation on how to add/edit slides dynamically http://photoswipe.com/documentation/api.html

@EugeneDae
Copy link

It seems to be completely impossible to remove a previous slide via pswp.items.splice(0,1) in beforeChange/gettingData without running into a ton of bugs and errors :(

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

3 participants