AnUpAm786
AnUpAm786

Reputation: 31

How to work with size of the browser window?

var wh = $(document.documentElement.clientHeight).height();
var tH = $('.a_Top').height();
var bH = $('.a_BottomBar_b').height();
$('.a_ContentOuter').css('min-height',(wh)+'px');
$('.a_ContentInner').css('min-height',(wh-(tH+bH+29))+'px');

I am writing this code in a function but when i open this page in Firefox, it will be a error and when we comment on this whole code it will be fine, so please give me the suggestion and help to find out the right way to use this code ....

Upvotes: 0

Views: 99

Answers (1)

Sameeraa4ever
Sameeraa4ever

Reputation: 568

Add $(window).height();

var wh = $(window).height();
var tH = $('.a_Top').height();
var bH = $('.a_BottomBar_b').height();
$('.a_ContentOuter').css('min-height',(wh)+'px');
$('.a_ContentInner').css('min-height',(wh-(tH+bH+29))+'px');
alert($('.a_ContentOuter').css('min-height'));

Upvotes: 3

Related Questions