A
Andy Jeffries
Hi all,
I want to write a function that given two elements will make their
heights equal to the larger element. I've had a go at it and it works,
but it makes both their heights larger than either of them (but equal)
The code is as follows:
var newheight = (second.offsetHeight > first.offsetHeight) ?
second.offsetHeight :
first.offsetHeight;
first.style.height = newheight + "px";
second.style.height = newheight + "px";
So, I'm obviously doing something stupid, but can anyone enlighten me?
I tried writing to offsetHeight but the changes seemed to be ignored.
Cheers,
Andy
I want to write a function that given two elements will make their
heights equal to the larger element. I've had a go at it and it works,
but it makes both their heights larger than either of them (but equal)
The code is as follows:
var newheight = (second.offsetHeight > first.offsetHeight) ?
second.offsetHeight :
first.offsetHeight;
first.style.height = newheight + "px";
second.style.height = newheight + "px";
So, I'm obviously doing something stupid, but can anyone enlighten me?
I tried writing to offsetHeight but the changes seemed to be ignored.
Cheers,
Andy