HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/MBoogaard/oosting-horseriding.com/CMS/oosting/media/system/galery/galery.js
pux = window.pux || {};

pux.gallery = pux.gallery || {};

pux.gallery.init = function() {
    if ($('.photos-to-show').children().length > 0) {
        var galleryHeight;
        var galleryEl = $('.photos-to-show');
        //$(window).load(function() {
            console.log("a");
            $('.gallery-expander').append('<div class="blue-bg"><span>'+$('.galery-more').html()+'</span></div>');
            galleryHeight = galleryEl.height(); 
            galleryEl.css('height', '0px');
            $('.gallery-expander').on('click', function() {
            if (galleryEl.height() == 0) {
                galleryEl.css('height', galleryHeight + 'px');
                $('.blue-bg').fadeOut(200);
            } else {
                /*galleryEl.css('height', '0px');
                $('.blue-bg').fadeIn(200);*/
            }
        });
        //});
    }
};

pux.gallery.resizeBox = function () {
    var maxHeight = $('.photos-to-show-height').height();
    $('.photos-to-show').css("height", maxHeight);
};

pux.gallery.expander = function() {
   //if ($('.photos-to-show-height').children().length > 0) {
        $('.five-photo-wrapper>a:last-of-type').wrap('<div class="gallery-expander"></div>');
        $('.gallery-expander').append('<div class="blue-bg"><span>'+$('.galery-more').html()+'</span></div>');
    //}
};

pux.gallery.spaner = function() {
    
};

pux.gallery.resizeBigImage = function () {
    var bigImageEL = $('.five-photo-wrapper>a:nth-child(1)');
    var newHeight;
    var smallImageWidth = $('.fancybox-img').not('.five-photo-wrapper>a:nth-child(1)').eq(0).width();
        
    $('.fancybox-img').not('.five-photo-wrapper>a:nth-child(1)').css('height', smallImageWidth + 'px');
    
    
    if ($(window).width() > 620 - 17) {
        newHeight = Math.round(2.0258 * smallImageWidth);
    } else {
        newHeight = Math.round(1.1 * smallImageWidth);
    }
    
    bigImageEL.css('height', newHeight + 'px');
};

pux.gallery.redraw = function() {
     $('.carousel-outer-wrapper').show().each(function () {
           setBxSlider($(this), 260);
    });
    
    //$(window).load(function () {
        if ($('.carousel-outer-wrapper').length > 0) {
            var newHeight = $('.person-img-wrapper img').eq(0).height() / 2 + 50; 
            newHeight += 'px';
            $('.bx-next').css('top', newHeight);
            $('.bx-prev').css('top', newHeight);   
        }
    //});
   /* $(window).load(function () {
        i   
        }
    });   */
    pux.gallery.resizeBigImage($('.five-photo-wrapper img').eq(2).height());
    pux.gallery.setHeaders();
};

pux.gallery.setHeaders = function() {
    setTimeout(function(){
        if($('.header-image-wrapper').length > 0) {
            var paddingBottom = 50;
            var headerHeight = $('.header-image-wrapper').height();
            var contentHeight = $('.fix-heading').height();
            
            if ($('.header-info').length > 0) {
                $('.fix-heading').css('top',  headerHeight - contentHeight - 25 + 'px');
                //alert($('.header-image-wrapper').css('padding-top'));
            } else {
                $('.fix-heading').css('top',  headerHeight - contentHeight - paddingBottom + 'px');   
            }
        }
    }, 200);
};

pux.gallery.fancy = function() {
    $('.fancybox-img').fancybox(
        {
            type    : 'image'
        }
    );
};

pux.initComponents = function () {
    pux.gallery.init();
    pux.gallery.resizeBigImage();
    pux.gallery.setHeaders();
    pux.gallery.redraw();
    pux.gallery.spaner();
};

pux.resizeComponents = function () {
    pux.gallery.resizeBox();
    pux.gallery.resizeBigImage();
    pux.gallery.redraw();
};

$(document).ready(function () {
    pux.initComponents();
});

$(window).resize(function () {    
    pux.resizeComponents();
});

$(window).load(function () {
    pux.gallery.resizeBigImage();
    pux.gallery.setHeaders();
    pux.gallery.fancy();
    pux.gallery.init();
});