Reputation: 449
why does it return 671 when i first time load the page with google chrome but it returns different value when i relad the page
$("#online").css({height: $(window).height()-40-$("#head").height()});
Upvotes: 0
Views: 907
Reputation: 560
Try setting up the layout on load and resize
$(window).on("load resize", function (e) {
$("#online").css({height: $(window).height()-40-$("#head").height()});
});
Upvotes: 3
Reputation: 5610
$("#online").css({ height: $(window).height() - 40 - $("#head").height() +'px' });
Upvotes: 0