File: D:/HostingSpaces/SBogers10/sportivo.komma.pro/wwwroot/js/main.js
/**
* Created by Pascal on 30/09/15.
*/
$(function(){
resizing();
$(window).resize(function(){
resizing();
});
jQuery.each(jQuery('textarea[data-autoresize]'), function() { //autosize TextArea
var offset = this.offsetHeight - this.clientHeight;
var resizeTextarea = function(el) {
jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset);
};
jQuery(this).on('keyup input', function() { resizeTextarea(this); }).removeAttr('data-autoresize');
});
});
function resizing(){
//Calculate the height for multiple blocks (max height in css defined)
$('.main-content').width($('body').width()-250+'px');
$('.image-header-container').height($('body').width()/3+'px');
$('.article:not(.latestArticle)').height(($('.article .article-image').width()/4)*2.5);
$('.background-article').height(($('.article .article-image').width()/4)*2.5);
$('.overview-block .overview-item .image-container').height(($('.overview-block .overview-item .image-container').width()/4)*2.5);
$('.content-red-block .background-image').height($('.content-red-block').height());
$('.sport-purpose .circle-row>div').height($('.sport-purpose .circle-row>div').width());
$('.side-by-side .circle').height($('.side-by-side .circle').width());
$('article .header-image').height($('article .header-image').width()/4*2.5);
jQuery.each(jQuery('.models.row>.row'), function() { //resize models to equal size next to each other
$(this).find('article').css('height','initial');
$(this).find('article').height($(this).height());
});
jQuery.each(jQuery('.zebra.row'), function() { //resize models to equal size next to each other
$(this).find('article').css('height','initial');
$(this).find('article').height($(this).height());
});
$('.sport-purpose-dimension').height($('.sport-purpose').height()*0.6);
}