Height, 100% does not work as most people would anticipate: it requires all parent elements to also have this height setting, but this possibly introduces other display-concerns.
In general it is better, and easier, to explore CSS solutions before resorting to JS. I would experiment with margins, negative margins, and overflow css properties. I appreciate, however, that you might wish to experiment with the JS code that you already have. But, of course, I can only speculate as I haven't seen your page.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity
." Me Myself & Irene
Validate your HTML