mwbarry Posted March 21, 2012 Share Posted March 21, 2012 I am trying to write a script that will put padding on the bottom of an element relative to the size of the screen minus the content and footer. This script works only when padhgt == tothgt, but not with the other 2 vars. Even when I set specific CSS height values for 'ja-content' & 'ja-footer', it still does not have a height value. Any ideas? <script type="text/javascript">function foothgt() { var tothgt = screen.height; var conthgt = document.getElementById('ja-content').style.offsetHeight; var fothgt = document.getElementById('ja-footer').style.offsetHeight; var padhgt = tothgt - conthgt - fothgt; document.getElementById('ja-mainbody').style.paddingBottom = padhgt + "px";}</script> Link to comment Share on other sites More sharing options...
Don E Posted March 21, 2012 Share Posted March 21, 2012 Try removing 'style' from the offsetHeight statements: var conthgt = document.getElementById('ja-content').style.offsetHeight; var fothgt = document.getElementById('ja-footer').style.offsetHeight; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.