Reloading glightbox not working as expected #431
Unanswered
arminfraude
asked this question in
Q&A
Replies: 1 comment
-
Do you have a codepen or something similar we can look at? A reduced test case helps us out a lot |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good day,
let's get straight to what I'm doing:
I am inserting images into my galleryLightbox object using Ajax calls or DOM manipulations.
This is done at the head of the array galleryLightbox.elements.
According to the description of the methods here, calling reload() on the lightbox object should then update it correctly:
Unfortunately, this is not quite true.
The array galleryLightbox.elements is now correctly extended with the new images.
However, galleryLightbox.slidesContainer is not updated correctly:
A new slide is inserted at the end, but it is empty when I try to zoom in.
After examining the elements in the browser's developer tools, in fact only the frame of a new slide is created with no content at all.
My expectation would have been that after correctly expanding galleryLightbox.elements and then reloading() the galleryLightbox object, this would then automatically update galleryLightbox.slidesContainer as well (based on the newly inserted elements in galleryLightbox.elements) and thus show correct behavior when zooming.
What am I doing wrong?
Have I misunderstood the functionality of glightbox.reload()?
Or maybe the problem arises from the fact that I insert the new image in galleryLightbox.elements[0] in the first step?
But actually it shouldn't matter, should it?
I am using glightbox-3.2.0.min.js
I kindly ask you for hints
Beta Was this translation helpful? Give feedback.
All reactions