Ninjakreborn Posted October 24, 2006 Share Posted October 24, 2006 [code]function autodivheight (div1, div2) { var divheight = document.div.getElementById('div1').style.height; document.div.getElementById('div2').style.height = divheight; //var divtochange = document.getElementById('div1').style.height; //document.getElementById('div2').style.height = div1;}</script></head><body onload="autodivheight (leftnav, rightcontent);">[/code]It's telling me expected object or something, unexpected object.Am I referencing my div's wrong, those are the id names for the div'sI also tried with the .div. Link to comment https://forums.phpfreaks.com/topic/24989-problem-with-error-in-javascript/ Share on other sites More sharing options...
Ninjakreborn Posted October 24, 2006 Author Share Posted October 24, 2006 I found out what I needed, I just have a question.How can I record the height of an element (for instance: div) using javascript., I need to trap the height of a div into a variable to use with some calculations, how do I do this? Link to comment https://forums.phpfreaks.com/topic/24989-problem-with-error-in-javascript/#findComment-113895 Share on other sites More sharing options...
fenway Posted October 26, 2006 Share Posted October 26, 2006 clientHeight and/or offsetHeight are useful, but I don't remember what FF does with these. Link to comment https://forums.phpfreaks.com/topic/24989-problem-with-error-in-javascript/#findComment-114892 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.