onResize event crashes IE, probably easy to a JavaScript'er
Posted: Sat Sep 04, 2004 7:37 am
Hi,
Can anyone see a better way to do this....?
I'm trying to make a table height that lives inside a table cell change dynamically if the cell height changes.
I have this code in my JS file.
and then something like this in my html
Doesn't work well in either browser (NS7 or IE6). In IE as soon as you resize the window IE stops responding. In NS7 when you resize it does its job but everytime you resize again it adds to the height so the height just keeps growing.
If anybody can see another way around this I'd be very grateful.
Thanks
Can anyone see a better way to do this....?
I'm trying to make a table height that lives inside a table cell change dynamically if the cell height changes.
I have this code in my JS file.
Code: Select all
function doNewHeight(tableId, cellId) {
document.getElementById(tableId).style.height = document.getElementById(cellId).offsetHeight
}Code: Select all
<table onResize="doNewHeight('table1','cell1')">
<tr>
<td id="cell1">
<table id="table1">
<tr>
<td>Bunch of pictures</td>
</tr>
</table>
</td>
</tr>
</table>If anybody can see another way around this I'd be very grateful.
Thanks