Open dyllandry opened 5 years ago
After setting the options property index
, I've found out that I cannot goTo()
the images two below or above the starting index. For example, if index = 4
then I cannot goTo()
index 2, 3, 5, or 6. If I set index = 8
the same issue occurs with indices 6, 7, 9, and 10.
I faced with the same issue
I have image elements which use
goTo()
and an index to open PhotoSwipe. Clicking on the first image brings up PhotoSwipe and I can use the left and right arrows to go through every image.However, clicking on the second and third images bring up PhotoSwipe with no image, just the black background. Clicking on the third image results in no error, but the second image errors with:
That is the same error as in this issue and this question, but neither's solution (making sure the index passed to
goTo()
is an int) works for me. I am definitely passing an int on click. Here is my click function.Here is my array of images prior to PhotoSwipe processing them.
When I go through all the images by bringing up PhotoSwipe via clicking on any image except the 2nd and 3rd, PhotoSwipe populates the array with more data. Pasted below you'll see that the second image's
center
property was defined where previously it erred due to being undefined. At this point clicking on the second image doesn't error, but is still black.Here's the same array after being through PhotoSwipe's viewer once.