<script>
jQuery(document).ready(function()
{
jQuery('#view_gallery').click(function()
{
var project_id = jQuery(location).attr('href').split("=")[1];
jQuery.ajax(
{
type: "GET",
url: "../project_listings/project_gallery.php?project_id=" + project_id,
dataType: "JSON",
success:function(data)
{
var pswpElement = document.querySelectorAll('.pswp')[0];
var items = [
{
src: 'PhotoSwipe-master/website/test/1.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/2.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/3.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/4.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/5.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/6.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/7.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/8.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/9.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/10.jpg',
w: 1200,
h: 900
},
{
src: 'PhotoSwipe-master/website/test/11.jpg',
w: 1200,
h: 900
}
];
var options = {
index: 0
};
var gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
gallery.init();
}
});
});
});
</script>