//clone every image to popup element when click
var floorplanImg = $('.detail-content.floorplan img'),
imgModal = $('.global-overlay-modal');
$(floorplanImg).addClass('pop-floorplan');
$(floorplanImg).each(function(index) {
$(this).on('click', function(){
$(imgModal).fadeIn(300).addClass('active').show();
var imgSingle = $(this).clone();
$('.img-popup-detail').html(imgSingle);
// console.log($(this).attr('src'));
if($(imgModal).hasClass('active')) {
$(imgModal).click(function (){
$(this).fadeOut(300);
});
}
});
});