Skip to content

Instantly share code, notes, and snippets.

@Yago
Created November 11, 2015 09:57
Show Gist options
  • Save Yago/89f6779dfc3d7f2ed2ab to your computer and use it in GitHub Desktop.
Save Yago/89f6779dfc3d7f2ed2ab to your computer and use it in GitHub Desktop.
PhotoSwipe - Click
$('a').click(function(event){
event.preventDefault();
var $pswp = $('.pswp')[0],
options = {
index: $(this).parent('figure').index(),
bgOpacity: 0.85,
showHideOpacity: true
};
// Initialize PhotoSwipe
var gallery = new PhotoSwipe($pswp, PhotoSwipeUI_Default, container, options);
gallery.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment