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/SBogers10/keystud.komma-mediadesign.nl/wwwroot/public/js/responsive_basic.js

// Elements
var $content = $('#content');
var $header = $('#header');
var $footer = $('#footer');

var $a = $('.a');
var $b = $('.b');
var $submenu = $('.bottom_menu');
var $article =  $('.article');

var $resp = $('img.resp');

checkViews(); // first resize
setTimeout(checkViews,500); // fallback for if fonts load slowly

if (browserName == 'IE' && majorVersion <= 8) {
    document.body.onresize = function () {
        checkViews();
    };
}
else {
    $(window).wresize(checkViews);
}

function checkViews()
{
    // Size variables
    var wSize = { w : window.innerWidth || document.documentElement.clientWidth, h : window.innerHeight || document.documentElement.clientHeight };
    var view = parseInt($('#view').width());

    switch(view)
    {
        // View 1
        case 1:
            // Set content height equal to the browsers height minus the height of the header
            var fullHeight = wSize.h - $header.outerHeight() - $footer.outerHeight();
            //if($a.height() > fullHeight) fullHeight = $a.height();


            $content.height(fullHeight);
            $a.height(fullHeight);

            // Keystud submenu
            var y = $article.offset().top + $article.outerHeight();
            $submenu.height('auto');
            if($submenu.offset().top < y - 5)
            {
                $submenu.css({ position : 'relative' });
            }
            else if($submenu.offset().top + $submenu.outerHeight() < wSize.h - $footer.outerHeight())
            {
                $submenu.css({ position : 'absolute'});
            }


            // Check height of b
            if($submenu.css('position') != 'absolute')
            {
                if(browserName != 'ie' || majorVersion > 8)
                {
                    var staticH = $article.outerHeight() + $submenu.outerHeight() + $footer.outerHeight();
                    $a.height(staticH);
                    $b.height(staticH);
                    $content.height(staticH);
                }
                else
                {
                    $b.height(fullHeight);
                }
            }
            else
            {
                $b.height(fullHeight);
            }

            // Image
            $resp.attr('src',$(this).attr('data-large'));
            $resp.one('load', function(){
                resizeImages();
            }).each(function() { if(this.complete) $(this).load(); });
                break;

        // View 2
        case 2:
            $content.height('auto');

            // Homepage
            $a.height('auto');
            var aH = Math.round($a.outerHeight());
            $submenu.height(aH);

            var bH = wSize.h - $header.outerHeight() - $a.outerHeight();
            if(bH < aH) bH = aH;
            $b.height(bH);

            $submenu.css({ position : 'relative'});

            $resp.attr('src',$(this).attr('data-small'));
            $resp.one('load', function(){
                resizeImages();
            }).each(function() { if(this.complete) $(this).load(); });
            break;

        // View 3
        case 3:
            $content.height('auto');
            $a.height('auto');
            $submenu.height('auto');
            $submenu.css({ position : 'relative'});

            var sH = Math.round($submenu.outerHeight());
            var bH = wSize.h - $header.outerHeight() - $a.outerHeight();
            if(bH < sH) bH = sH;
            $b.height(bH);

            $resp.attr('src',$(this).attr('data-small'));
            $resp.one('load', function(){
                resizeImages();
            }).each(function() { if(this.complete) $(this).load(); });

    }
    // Always
    resizeImages();
}