"); $(document).find(".ays_gallery_body_10").append(aysGalleryContent_10); $( window ).resize(function() { $(document).find(".mosaic_10").Mosaic({ innerGap: 5, refitOnResize: true, showTailWhenNotEnoughItemsForEvenOneRow: true, maxRowHeight: 250, maxRowHeightPolicy: "tail" }); var aysgrid_10 = $("#ays_masonry_grid_10").masonry({ percentPosition: false, itemSelector: ".ays_masonry_grid-item", columnWidth: ".ays_masonry_item_10", transitionDuration: ".8s", gutter: 5, }); setTimeout(function(){ aysgrid_10.masonry("layout"); }, 400); }); $(document).find('.ays_gallery_container_10 .ays_masonry_item_10').hover(function(){ $(this).find('.ays_hover_mask').css('animation-name', 'fadeIn'); $(this).find('.ays_hover_mask').css('animation-duration', '.5s'); $(this).find('.ays_hover_mask').css('opacity', '1'); }, function(){ $(this).find('.ays_hover_mask').css('animation-name', 'fadeOut'); $(this).find('.ays_hover_mask').css('animation-duration', '.5s'); $(this).find('.ays_hover_mask').css('opacity', '0'); }); $(document).find("ays_masonry_item_10").on("mouseover", function(){ if($(this).find(".ays_hover_mask .ays_image_title").length != 0){ $(this).find(".ays_hover_mask>div:first-child").css("margin-bottom", "40px"); } }); $(document).find(".ays_masonry_item_10 div.ays_hover_mask").find(".ays_image_url").on("click", function(e){ setTimeout(function(){ $(document).find(".lg-close.lg-icon").trigger("click"); },450); window.open($(this).attr("data-url"),"_blank"); }); $(document).find(".ays_masonry_item_10 div.ays_link_whole_image_url").on("click", function(e){ setTimeout(function(){ $(document).find(".lg-close.lg-icon").trigger("click"); },450); window.open($(this).attr("data-url"),"_blank"); });$(document).find('.gpg_loader_10').css({'display': 'flex', 'animation-name': 'fadeIn'}); var aysgrid_10 = $("#ays_masonry_grid_10").masonry({ percentPosition: false, itemSelector: ".ays_masonry_grid-item", columnWidth: ".ays_masonry_item_10", transitionDuration: ".8s", gutter: 5, }); setTimeout(function(){ $(document).find(".ays_gallery_container_10 .mosaic_10").Mosaic({ innerGap: 5, refitOnResize: true, showTailWhenNotEnoughItemsForEvenOneRow: true, maxRowHeight: 250, maxRowHeightPolicy: "tail" }); aysgrid_10.masonry("layout"); },300); var gpgSearchLightboxOptions = { selector: ".gpgSearchContainer", share: false, hash: false, addClass:"ays_gpg_lightbox_10", fullScreen: false, autoplay: false, pause: 5000, progressBar: true, mousewheel: false, keyPress: false, actualSize: false, pager: false, download: false, autoplayControls: true, counter: true, showThumbByDefault: false, getCaptionFromTitleOrAlt: false, subHtmlSelectorRelative: true }; /*AV Search Image*/ $(document).on("input", "#inp_search_img_10", function(e) { var ays_for_srch_cont = $(document).find("#ays_masonry_grid_10 .ays_masonry_item_10"); var this_val = $(this).val().toLowerCase(); for(var srch_i = 0; srch_i < ays_for_srch_cont.length; srch_i++){ var srch_desc = ays_for_srch_cont.eq(srch_i).data("desc").toLowerCase(); var srch_img_div = ays_for_srch_cont.eq(srch_i); srch_img_div.removeClass("gpgSearchContainer"); if(srch_desc.indexOf(this_val) == -1){ srch_img_div.fadeOut(400); setTimeout(function(){ aysgrid_10.masonry("layout"); }, 400); }else{ if(this_val == ""){ srch_img_div.removeClass("gpgSearchContainer"); }else{ srch_img_div.addClass("gpgSearchContainer"); } if($(this).parents("[class^=\"ays_gallery_container\"]").find(".ays_grid_row").length > 0){ if(parseInt(srch_img_div.css("margin-right")) == 0){ srch_img_div.css("margin-right","2.5px"); } } srch_img_div.fadeIn(400); setTimeout(function(){ aysgrid_10.masonry("layout"); }, 400); } } if(this_val != ""){ $(document).find("#ays_masonry_grid_10").data("lightGallery").destroy(true); $(document).find('#ays_masonry_grid_10').lightGallery(gpgSearchLightboxOptions); }else{ $(document).find("#ays_masonry_grid_10").data("lightGallery").destroy(true); $(document).find("#ays_masonry_grid_10").lightGallery({ selector: ".ays_masonry_item_10", share: false, hash: false, addClass:"ays_gpg_lightbox_10", fullScreen: false, autoplay: false, pause: 5000, progressBar: true, mousewheel: false, keyPress: false, actualSize: false, pager: false, download: false, autoplayControls: true, counter: true, showThumbByDefault: false, getCaptionFromTitleOrAlt: false, subHtmlSelectorRelative: true }); } });$(document).find('#ays_masonry_grid_10').lightGallery({ selector: '.ays_masonry_item_10', share: false, hash: false, addClass:'ays_gpg_lightbox_10', fullScreen: false, autoplay: false, pause: 5000, progressBar: true, mousewheel: false, keyPress: true, escKey: true, actualSize: false, pager: false, download: false, autoplayControls: true, counter: true, showThumbByDefault: false, getCaptionFromTitleOrAlt: false, subHtmlSelectorRelative: true });$(document).find('.ays_gallery_container_10').imagesLoaded() .done( function( instance ){ $(document).find('.ays_gallery_container_10').css({'display': 'block', 'animation-name': 'fadeIn'}); $('#ays_grid_row_10 img.ays_gallery_image').each(function(){ var realWidth = this.width; var ratio = parseFloat(1)*realWidth; $('#ays_grid_row_10 img.ays_gallery_image').each(function(e) { $(this).height(ratio); }); }); $(document).find('.gpg_loader_10').css({'display': 'none', 'animation-name': 'fadeOut'}); $(document).find('.ays_gallery_container_10 .mosaic_10').Mosaic({ innerGap: 5, refitOnResize: true, showTailWhenNotEnoughItemsForEvenOneRow: true, maxRowHeight: 250, maxRowHeightPolicy: 'tail' }); setTimeout(function(){ aysgrid_10.masonry('layout'); },300); var ays_gallery_containers = $(document).find('.ays_gallery_container_10'); ays_gallery_containers.css({ position: 'static' }); $(window).trigger('resize'); }) .fail( function() { var errorImage = $('
Algunas imágenes no se han cargado
'); $(document).find('.ays_gallery_container_10').prepend(errorImage); $(document).find('.ays_gallery_container_10').css({'display': 'block', 'animation-name': 'fadeIn'}); $(document).find('.gpg_loader_10').css({'display': 'none', 'animation-name': 'fadeOut'}); $(document).find('.ays_masonry_item_10>img, .ays_mosaic_column_item_10>img, .ays_grid_column_10>img').each(function(e, img){ if(img.getAttribute('src') == '' || img.getAttribute('src') == undefined){ $(this).css('display', 'none'); $(this).parent().find('.ays_hover_mask').remove(); $(this).parent().find('.ays_image_loading_div').css({ 'opacity': '1', 'animation-name': 'tada', 'animation-duration': '.5s', 'display': 'block', 'padding-top': 'calc(50% - 25px)', }); $(this).parent().find('.ays_image_loading_div').find('img').css('position', 'static'); $(this).parent().find('.ays_image_loading_div').find('img').attr('src', 'https://caravaningalava.org/wp-content/plugins/gallery-photo-gallery/public//images/error-404.png'); var ays_err_massage = $('
Image not found!'); var img_parent = $(this).parent().find('.ays_image_loading_div').eq(0); img_parent.append(ays_err_massage); $(this).parent().css('height', '200px');$(this).remove(); } }); setTimeout(function(){ aysgrid_10.masonry('layout'); $(window).trigger('resize'); },300); }); },1000); }); })(jQuery);