mwbarry Posted March 20, 2012 Share Posted March 20, 2012 I am trying to write a script similar to this one: http://w3schools.invisionzone.com/index.php?showtopic=42074that will make the minimum height of a content box 16px less than that of a sidebar. When I run this script I get an error message in the console that says "Uncaught TypeError: Cannot read property 'style' of null" Here is the script: <script type="text/javascript">function contentheight() { var sideheight = document.getElementById('ja-col1'); var sideitem = sideheight.offsetHeight; document.getElementById('ja-content-inner').style.minHeight = sideitem - 16 + "px";}</script> Any idea what I am doing wrong? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 20, 2012 Share Posted March 20, 2012 That means that the element wasn't found on the page. Link to comment Share on other sites More sharing options...
thescientist Posted March 22, 2012 Share Posted March 22, 2012 in other words, double check the reference you are assuming of this statement document.getElementById('ja-content-inner').style.minHeight Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.