1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
   | function resize() {
	var playerContainer = $(".bottom_fixed");
	var playerSize = playerContainer.is(":visible") ? playerContainer.height() : 0;
 
	var navContainer = $(".navbar");
	var navSize = navContainer.height();
 
	_scrHeigth = $(window).height();
	_scrWidth = $(window).width();
 
	_imgRatio = _imgBackW / _imgBackH;
 
	var footerSize = $(".footer_common_page").height();
	var contentSize = _scrHeigth - playerSize - navSize;
 
	_scrRatio = _scrWidth / contentSize;
 
	if (_imgRatio < _scrRatio) {
		_imgBackW = _scrWidth;
		_imgBackH = Math.round(_scrWidth / _imgRatio);
 
	}
	else {
		_imgBackH = contentSize;
		_imgBackW = Math.round(contentSize * _imgRatio);
	}
 
	$("div.home_content").height(contentSize);
	$("div.home_content").css("background-repeat", "no-repeat");
	$("div.home_content").css("background-size", _imgBackW + "px " + _imgBackH + "px");
 
	//Home	
	$(".content-fixed").css("bottom", playerSize + "px");
	if (playerContainer.is(":visible")) {
		$("footer").css("padding-bottom", playerSize + "px");
	}
	//Main
	$("div.all_content").css("min-height", contentSize);
	$("#pusher").css("height", footerSize + playerSize);
	$(".footer_common_page").css("bottom", playerSize);
} | 
Partager