I have this site:
It is a problem when accessing the homepage of the website higher resolutions
(On the small is ok).
For example for this resolution (1920×1200) site appears like in the picture below.
CODE JS:
var screenH = jQuery(window).height();
console.log("Inaltimea ecranului este:",screenH);
var headerH=jQuery('header').outerHeight();
console.log("Inaltimea headerului este:",headerH);
var footerH=jQuery('footer').outerHeight();
console.log("Inaltimea footerului este:",footerH);
var calcul=screenH-headerH-333-2;
console.log("Rezultatul este:",calcul);
jQuery('#main').css( "height", calcul );
I put this code in the function window.load function.
But unfortunately it does not work … I did not realize that my picture is not until the end.
Can you help me solve this problem please?
Thanks in advance]2
Your function does work, but it takes some time to get fired. This is the exact reason why you should try to resize the image with css only. background-size should do the job by itself.