File: D:/HostingSpaces/SBogers10/keystud.komma-mediadesign.nl/wwwroot/public/js/responsive_main.js
var h = $('body').height();
//$('body,html').height(h - $('#footer').outerHeight());
/* Let all responsive images fit in their containers */
function resizeImages()
{
//var small = $(this).attr('data-small');
$('img.resp').one('load', function(){
$img = $(this);
$img.stop().animate({ opacity: 1 },300);
// Images adjust in full-width or full-height,
// depending on ratio and parent dimensions
var ratioI = $img.width() / $img.height();
var ratioP = $img.parent().width() / $img.parent().height();
if(ratioP >= ratioI)
{
// Make image as wide as parent
$img.width($img.parent().width());
$img.height($img.parent().width() / ratioI);
}
else
{
// Make image as high as parent
$img.height($img.parent().height());
$img.width($img.parent().height() * ratioI);
}
$img.css({ display: 'block', marginLeft : $img.width() / -2 +'px',marginTop : $img.height() / -2 +'px' });
//console.log('image: w: ' + $img.width() + ' h: ' + $img.height() + ' parent: w: ' + $img.parent().width() + ' h: ' + $img.parent().height());
}).each(function() { if(this.complete) $(this).load(); });
}