Photoswipe - add images during gallery display

I know that just adding images to the photo list using jquery, but I cannot figure out how to update the list of images while viewing the gallery, i.e. without going back to the list of images. An alternative (without jquery, because it adds images directly to the photoswipe instance), I found that I should use the code below, but it seems that the only way to update the list in the gallery is to return to the first image (before going to the first image all mess). Is there a function to update the list when viewing the gallery?

for (i = 0; i < fileList.length; i++) { //add new image list
      console.log(fileList[i]);
      instance.cache.images.push(new Code.PhotoSwipe.Image.ImageClass(fileList[i], fileList[i].url, fileList[i].caption, ''));
    };
+1
source share
1 answer

PhotoSwipe, .

documentation (. ), pswp - PhotoSwipe ( PhotoSwipe() ).

pswp.items.push({
  src: "path/to/image.jpg", 
  w:1200,
  h:500 
});

PhotoSwipe v4.1.1

0

All Articles