D
DaveO
OK. Now I'm all googled out and still puzzled !
I admit I am very new to javascript, but think that it is the only solution
to this.
I have a web page with a table ( 2 columns, 1 row )
The left cell width is set at 150px
The right cell at 100%
The right cell contains an iFrame. The iFrame width is 100% & height 100%
This is what I want to happen :
I don't want scroll bars either on the right or bottom.
When the browser is resized, the left cell width remains unchanged, but the
height adjusts to the browsers height. Works fine.
The right cell resizes fine.
The iFrame does not.
If I set the iFrame width to 100% and height to 100%, the width resizes but
the height doesn't change.
If I set the iFrame height as a numeric value ( eg.. height=300 ) it changes
to that size.
After googling, I found this :
function changeIframe()
{
var new_height = document.getElementById('table1').height;
document.getElementById('cFrame1').height = new_height;
}
window.onresize= changeIframe;
</script>
I understand that this --should-- read the height from the table and set the
iFrame height using this value.
However, the table's height is "100%" and I think that I need to get the
height in pixels as the iFrame appears to ignore '%' for height values.
Any suggestions most welcome.
Regards
DaveO
I admit I am very new to javascript, but think that it is the only solution
to this.
I have a web page with a table ( 2 columns, 1 row )
The left cell width is set at 150px
The right cell at 100%
The right cell contains an iFrame. The iFrame width is 100% & height 100%
This is what I want to happen :
I don't want scroll bars either on the right or bottom.
When the browser is resized, the left cell width remains unchanged, but the
height adjusts to the browsers height. Works fine.
The right cell resizes fine.
The iFrame does not.
If I set the iFrame width to 100% and height to 100%, the width resizes but
the height doesn't change.
If I set the iFrame height as a numeric value ( eg.. height=300 ) it changes
to that size.
After googling, I found this :
function changeIframe()
{
var new_height = document.getElementById('table1').height;
document.getElementById('cFrame1').height = new_height;
}
window.onresize= changeIframe;
</script>
I understand that this --should-- read the height from the table and set the
iFrame height using this value.
However, the table's height is "100%" and I think that I need to get the
height in pixels as the iFrame appears to ignore '%' for height values.
Any suggestions most welcome.
Regards
DaveO