PhotoSwipe icon indicating copy to clipboard operation
PhotoSwipe copied to clipboard

add a new image to photoswipe gallery

Open moa7ed opened this issue 14 years ago • 0 comments

when I try to append the new image to the list by $("#galleryOne").prepend("

  • <a href="images/full/010.jpg" rel="external"><img src="images/thumb/010.jpg" alt="Image 010" />
  • "); $("ul.gallery a").photoSwipe(); it is ok and the image is shown and work but there is problem that this image isn't really added to the other images if I click on it,it works. but when click on its previous image and then click next it doesn't work So I tried this code

    $("#galleryOne").prepend("

  • <a href="images/full/010.jpg" rel="external"><img src="images/thumb/010.jpg" alt="Image 010" />
  • "); var photoS = $("ul.gallery a").photoSwipe(); image={url: 'images/full/010.jpg', caption: 'Image 010'} src = photoS.settings.getImageSource(image); caption = photoS.settings.getImageCaption(image); metaData = photoS.settings.getImageMetaData(image); photoSwipe = Code.PhotoSwipe; photoS.cache.images.push(new photoSwipe.Image.ImageClass(image, src, caption, metaData));

    as it is the same code that written in initialize method but the same problem happens and also when click on any image this error is shown: Uncaught Code.PhotoSwipe.activateInstance: Unable to active instance as another instance is already active for this target

    moa7ed avatar Aug 12 '12 14:08 moa7ed