Jump to content


Photo

problem with error in javascript


  • Please log in to reply
2 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 24 October 2006 - 09:45 PM

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);">
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's
I also tried with the .div.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 24 October 2006 - 09:45 PM

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?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 26 October 2006 - 05:11 PM

clientHeight and/or offsetHeight are useful, but I don't remember what FF does with these.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users