-
Dynamically resize IFrame?
Hello all.
I have an IFRAME control inside of an HTML document. The content of the IFRAME
is injected with some jscript code by using the Open(), write() and close()
methods. The IFRAME is absolutely positioned and is floating.
I would like to figure out how to make the IFRAME resizable so that no scrollbars
ever appear. I have been trying to see if any of the properties of the IFRAME
"tell" me that there are scrollbars, but so far I'm coming up empty.
Any suggestions?
-
Re: Dynamically resize IFrame?
Yes, haven't a conversation with myself.
Isn't this funny? After posting this message, I finally figured out how to
do what I was after. This was after spending a few brain cells every week
thinking about how this might get done (it hasn't been a high priority item).
The answer was this:
var dF = document.all.myFrame //ref to iFrame control
dF.style.display="block" // make visible
dF.height=10000;
dF.height = document.frames("myFrame").document.body.scrollHeight
The initial setting of 10000 fixed a problem where the window wasn't tall
enough initially, but if I displayed it again with the same text, it was
the right size. The display was also required as this iFrame is only displayed
in the onmouseover and hidden in onmouseout.
-Chuck
"Chuck" <curwiler@comcast.net> wrote:
>
>Hello all.
>
>I have an IFRAME control inside of an HTML document. The content of the
IFRAME
>is injected with some jscript code by using the Open(), write() and close()
>methods. The IFRAME is absolutely positioned and is floating.
>
>I would like to figure out how to make the IFRAME resizable so that no scrollbars
>ever appear. I have been trying to see if any of the properties of the IFRAME
>"tell" me that there are scrollbars, but so far I'm coming up empty.
>
>Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks