Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Dynamically resizing an iframe
- From: javascript@xxxxxxxxxx (Herzner, Daniel)
- Subject: [Javascript] Dynamically resizing an iframe
- Date: Thu, 29 Nov 2001 10:38:34 -0500
Hi All, I'm trying to include an iframe on a web page whose source is an
.asp file. I want the frame to be sized dynamically depending upon the size
of its src. The src file will always be a fixed width but the height can
vary quite a bit. I found a technet article that made doing this sound
pretty easy. The article only talks about doing this with an htm file as the
src. Am I having trouble doing this because I'm using an .asp file? The
article includes some javascript:
function reSize()
{
try{
var oBody = ifrm.document.body;
var oFrame = document.all("ifrm");
oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight -
oBody.clientHeight);
oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth -
oBody.clientWidth);
}
//An error is raised if the IFrame domain != its container's domain
catch(e)
{
window.status = 'Error: ' + e.number + '; ' + e.description;
}
}
and then the html:
<BODY onload=reSize()>
<iframe onresize=reSize() id=ifrm src=YOUR_PAGE_HERE></iframe>
</BODY>
So, I'm doing all of this but it's not making a difference to what I'm
trying to achieve. Can someone out there please give me a hand with this?
I've done my homework but still can't see how to pull this off. Thanx in
advance everyone...
Dan Herzner
phn: 203-588-2294
fax: 203-588-2460
- Follow-Ups:
- [Javascript] Dynamically resizing an iframe
- From: Shawn Berg
- [Javascript] Dynamically resizing an iframe
- Prev by Date: [Javascript] REMOVE, please
- Next by Date: [Javascript] Dynamically resizing an iframe
- Previous by thread: [Javascript] REMOVE, please
- Next by thread: [Javascript] Dynamically resizing an iframe
- Index(es):