I'm working on a small JavaScript library to make dynamic grids on websites. Anyway, things are going pretty well, except sometimes I notice a sizable white space at the bottom of my div in Chrome. This tends to pop up in two situations:
1) When the browser is open to it's full window size.
2) If the grid elements are small.
Here is the page style where it happens most.
Now, this is a problem because the JavaScript code is written specifically to take the window size, and create elements of the correct size to fill the screen. It works perfectly in Firefox.
If you check that out with Chrome with a full window, you'll notice a white space at the bottom. Then, if you resize the window to half-size or so, it disappears. Also relevant, this issue is not happening in Firefox at - no extra white space anywhere.
Here is a JS fiddle that should recreate the problem. Same deal, white space in Chrome (might need to resize the view window) and no white space in Firefox.
Any ideas out there about what might be the issue? I've read a lot of similar posts and poked around with a lot of the standard problems, such as border-box
, vertical-align
and things like that. I haven't gotten anywhere though.
EDIT: I've also done some debugging in the console. For example, checking the window height versus the height of the div versus the height of all the elements combined leads nowhere.
$(window).height()
=> 656
$('#patchwork').height()
=> 656
Patchwork.dimensions.Y
=> 656
Patchwork.patchSize.Y * Patchwork.patchCount.Y
=> 656
This is basically saying that everything thinks and expects to take up all 656 pixels, but for some reason it is not actually filling the entire space.