I have a grid that I am attempting to size based on the div size that contains it. I am using the following code:
gridElement = $(
dataArea = gridElement.find(
gridHeight = h,
otherElements = gridElement.children().not(
otherElementsHeight = 0;
otherElementsHeight += $(
dataArea.height(gridHeight - otherElementsHeight);
It is based on a fiddle that Dimo posted in another thread. The h parameter is the height of the div that contains the grid.
The problem is that when the page is first loaded the grid causes a scrollbar to appear. If I then resize the browser or maximize the grid appears as it should. How can I get it set to the correct height on first load?
I have attached two images one showing the grid as it appears on load and one after any resize or maximze etc...