
February 21st, 2007, 10:56 AM
|
|
Registered User
|
|
Join Date: Dec 2006
Posts: 3
Time spent in forums: 3 h 5 m 56 sec
Reputation Power: 0
|
|
|
Doctype messing with expandable iframe in firefox
when i use an xhtml doctype, the expandable iframe on a page doesnt work with firefox. it will work with ie 6,7. heres a sample code:
function adjustIFrameHeight()
{
try
{
//find the height of the internal page
var theHeight = document.getElementById('myframe').contentWindow.document.body.scrollHeight;
//change the height of the iframe
document.getElementById('myframe').style.height = theHeight + 20;
} catch(e)
{
//alert("error");
}
scroll(0, 0);
}
the iframe with a set height calls the function and expands the height to fit the content. to solve this problem and allow firefox to adjust correctly, i have to switch to a html 4.01 Transitional doctype. using a transitional doctype is the only way ive found to get it to work. does anyone have any suggestions on what i should do? thanks.
|