[ad_1]
03:27
document.getElementById(‘dvid6976836’).addEventListener(‘loadedmetadata’, function () { ANALYTICSLIBRARY.init([“881730”, “1683”]); ANALYTICSLIBRARY.loadAnalyticsParam(); }, wrong); document.getElementById(‘dvid6976836’).addEventListener(‘Playback’, function () { ANALYTICSLIBRARY.init([“881730”, “1683”]); ANALYTICSLIBRARY.playAnalyticsParam(); }, wrong); document.getElementById(‘dvid6976836’).addEventListener(‘end’, function () { ANALYTICSLIBRARY.init([“881730”, “1683”]); ANALYTICSLIBRARY.endAnalyticsParam(); }, wrong);
$(document).ready(function () { let isDesktopInit = false; let detailSize = “full”; let displayhgt = “95vh”; let $this = $(‘[data-fancybox]’).fancybox($.extend(true, {}, $.fancybox.defaults, { button: [‘share’]caption: function (instance, item) { var caption = ”; if (item.type === ‘image’) { if (isMobile()) { caption += ‘
‘ + $(this).find(‘figcaption’).html() + getDetailsURL($(this).parent()) + getDownloadURL($(this).parent()) + showFBShare() + ‘
‘+’
‘+’
} else { Caption += $(this).find(‘figcaption’).html() + getDetailsURL($(this).parent()) + getDownloadURL($(this).parent()) + showFBShare( ); returns the caption. }, afterLoad: function (instance, current) { //initial desktop view if (isMobile()) $(“.fancybox-caption__body”).addClass(“mobile”); }, afterShow: function (instance, current) { var $currentSlide = $(“.fancybox-slide.fancybox-slide–current.fancybox-slide–image”).parent().parent(); if (isMobile()) $currentSlide.find(“.fancy-detail -link”).on(“touchstart”, function() { captionToggle(); }); }, afterClose: function () { } })); $(window).on(“Resize”, function (event) { if (isMobile()) return; if ($(“.af3-caption-body”).length > 0 && $(“.af3-caption- body”).css(“height”) != undefined) { event.stopImmediatePropagation(); $(“.fancybox-caption__body”).removeClass(“half”); isDesktopInit = false; captionToggle(); debounceTimer = setTimeout( function () { clearTimeout(debounceTimer); debounceTimer = null; recalculateImageSize(); }, 1000); } }); function recalculateImageSize() { // Fancy box miscalculates due to race condition with new layout var origImgWth = $(“.fancybox-image”).prop(“naturalWidth”); var origImgHgt = $(“.fancybox-image”).prop(“naturalHeight”); var winWth = $(window).innerWidth() var winHgt = $(window).innerHeight() var ratio = Math.min(winWth / origImgWth, winHgt / origImgHgt); var newImgWth = (origImgWth * ratio); var newImgHgt = (origImgHgt * ratio); var dstTop = Math .floor((winHgt – newImgHgt)) / 2; var dstLeft = Math.floor((winWth – newImgWth)) / 2; $(“.fancybox-content”).removeAttr(“style”); $(“.fancybox -content”).css(“width”, newImgWth + “px”); $(“.fancybox-content”).css(“height”, newImgHgt + “px”); $(“.fancybox-content”) .css(“transform”, “translate(” + dstLeft + “px,” + dstTop + “px)”); } function captionToggle() { if ($(“.fancybox-caption__body”).hasClass(“af3- caption-body”)) { $(“.af3-caption-body”).stop(true, false).animate ({ height: “0vh” }, 800, function () { // Animation done. closeDetails(); }); $(“.fancy-photo-detail-link”).html($(“.fancy-photo-detail-link”).html().replace(“CLOSE”, “SHOW” )); } else { $(“.fancybox-caption__body”).addClass(“af3-caption-body”); $(“.af3-caption-body”).addClass(detailSize); $(“.af3- caption-body”).animate({ height: displayhgt }, 800); $(“.fancybox-caption”).addClass(“af3-caption-bg”); $(“.base-caption-info”) .addClass(“Full height”); $(“.fancy-photo-detail-link”).addClass(“photo-detail-gradient”); $(“.fancybox-button”).css(“Display”, “ None”); $(“.fancy-photo-detail-link”).html($(“.fancy-photo-detail-link”).html().replace(“SHOW”, “CLOSE”)); $(“.fancybox-caption__body”).prepend(prependClosing()); $(“.closing-box, .closingx”).on(“touchstart”, function() { captionToggle(); }); } } function getDetailsURL(fbObj) { return ‘DETAILS’; } function getDownloadURL(fbObj) { return ‘DOWNLOAD’; } function showFBShare() { return ”; } function closeDetails() { $(“.af3-caption-body”).removeClass (detailSize); $(“.fancybox-caption__body”).removeClass(“af3-caption-body”); $(“.fancybox-caption”).removeClass(“af3-caption-bg”); $(“. base-caption-info”).removeClass(“Full height”); $(“.fancy-photo-detail-link”).removeClass(“photo-detail-gradient”); $(“.fancybox-button”). css(“display”, “block”); if (detailSize === “half”) { detailSize = “full”; displayhgt = “90vh”; $(“.fancybox-caption”).removeClass(“desktop-init ”); } } Function prependClosing() { return ‘
[ad_2]
Source link