Why does the resizing of the content does not work in Firefox?

76 views Asked by At

The Code makes that every content fits to the size of the browser. It works perfectly in webkit so:

Why does this not function in Firefox ?

window.onresize = function(event) {
resizeDiv();
};

function resizeDiv() {
vph = $(window).height();
$('#content').css({'min-height': vph + 'px'});
$('#content1').css({'min-height': vph + 'px'});
$('#content2').css({'min-height': vph + 'px'});
$('#content3').css({'min-height': vph + 'px'});
$('#content4').css({'min-height': vph + 'px'});
$('#content5').css({'min-height': vph + 'px'});
$('#content6').css({'min-height': vph + 'px'});
$('#content7').css({'min-height': vph + 'px'});
$('#content8').css({'min-height': vph + 'px'});
$('#content9').css({'min-height': vph + 'px'});
};
1

There are 1 answers

1
HIRA THAKUR On

If you are open to jquery,this should work:

 $(window).resize(function () {
    resizeDiv();
    });

Otherwise in plain javascript:

window.onresize=resizeDiv;

should be enough for all browsers.