...

View Full Version : Layer resize problem..



JHallam
08-22-2002, 02:32 PM
I have the following JS function which onload checks the size of two divs that are side by side, and resizes the smaller one to the same size as the larger div, so that they appear to be the same height.


function resizeDiv(){
var focusHT = document.getElementById("focus").offsetHeight;
var thesHT = document.getElementById("thes").offsetHeight;
if(focusHT < thesHT){
document.getElementById("focus").style.height = thesHT-20;
}else if(focusHT > thesHT){
document.getElementById("thes").style.height = focusHT-20;
}
}


...which works fine in IE. My question is - what attributes should I be using instead of offsetHeight to intially read the height of each div in netscape/mozilla? I also tried replacing offsetHeight with height and clientHeight, but that didnt work either...

x_goose_x
08-22-2002, 03:21 PM
Try this link (http://www.xs4all.nl/~ppk/js/doctypes.html)

JHallam
08-23-2002, 01:47 AM
Nope, that wasnt useful I tried most ways and still cant emplement it right, any help with the script, any one get this working? please if you could, muchly appreciated

thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum