Your IP : 216.73.216.144


Current Path : /var/www/ooareogundevinitiative/wp-content/plugins/photoswipe-masonry/
Upload File :
Current File : /var/www/ooareogundevinitiative/wp-content/plugins/photoswipe-masonry/photoswipe-masonry.min.js

jQuery(function($){var $pswp=$(".pswp")[0];var image=[];jQuery(".photoswipe_gallery").each(function(){var $pic=$(this),getItems=function(){var items=[];$pic.find("a").each(function(){var $href=jQuery(this).attr("href"),$size=jQuery(this).data("size").split("x"),$width=$size[0],$height=$size[1];var item={src:$href,w:$width,h:$height,el:$(this),msrc:$(this).find("img").attr("src"),title:$(this).attr("data-caption")};items.push(item)});return items};var items=getItems();$.each(items,function(index,value){image[index]=new Image;image[index].src=value["src"]});$pic.on("click","figure",function(event){event.preventDefault();var $index=jQuery(this).index();var testfunc=function(index){var image=items[index].el.find("img");offset=image.offset();console.log(offset.left,offset.top,image.width())};testfunc($index);var options={index:$index,bgOpacity:.9,showHideOpacity:false,getThumbBoundsFn:function(index){var image=items[index].el.find("img"),offset=image.offset();return{x:offset.left,y:offset.top,w:image.width()}}};var lightBox=new PhotoSwipe($pswp,PhotoSwipeUI_Default,items,options);lightBox.init()})});jQuery(".single_photoswipe").each(function(){var $pic=$(this),getItems=function(){var items=[];$pic.each(function(){var $href=jQuery(this).attr("href"),$size=jQuery(this).data("size").split("x"),$width=$size[0],$height=$size[1];var item={src:$href,w:$width,h:$height,el:$(this),msrc:$(this).find("img").attr("src")};items.push(item)});return items};var items=getItems();$.each(items,function(index,value){image[index]=new Image;image[index].src=value["src"]});$pic.on("click","img",function(event){event.preventDefault();var $index=jQuery(this).index();var options={index:$index,getThumbBoundsFn:function(index){var image=items[index].el.find("img"),offset=image.offset();return{x:offset.left,y:offset.top,w:image.width()}}};var lightBox=new PhotoSwipe($pswp,PhotoSwipeUI_Default,items,options);lightBox.init()})})});