Dynamic Iframes
- Started
- Last post
- 10 Responses
- esko
I'm trying to get my iframe to resize dynamically.
I've got a header (100px), and a footer (50px), I want the header to stay at the top of the screen while the footer rests at the bottom and I want this to happen for each user that accesses the page. I want the Iframe to be inbetween the two and to act dynamically so that it resizes to the area between the header and footer. All content in the iframe will scroll but the main page will never scroll.
I tried using a percent and a "*" for the iframe but it seems to want pixels.
I've been trying to write something simple but it's not working out, could someone tell me if im on the right track, or give me some help with the correct way to write this.
docheight = document.body.clientheight
iframeheight = (docheight - 150)
(i used 150 because that is the header and footer added together)
and then just call iframeheight when inputting my height for the iframe, something like:
iframe src="page.html" width=446 height=iframeheight
Will this work if it's coded correctly? Has anyone got this to work a different way?
Thanks.
- esko0
and I do realize this could be done using regular frames but I over simplified what I needed to do because if I can get the answer to this it will work fine for what I need.
- esko0
Nevermind I got it. If anyone would like to check out the code let me know.
I'm still kind of testing but the iframe is resizing upon entry.
- matt240
i'd like to see
- mbr0
Yeah, I'd love to see it, too.
- STB0
i want in too...
- extric8or0
yeah post the link plz
- screename0
I'd love to see that as well man. link plz?
- Redmond0
Can't you just stick them in layers?
- nightnerd0
pleeeaaase!
x8)
- esko0
like i said it's still in test and it could use something to resize it when the browser resizes, maybe ill work on that today.
(the design sucks for various reasons, my laziness, and the clients ideas of what they want. At least I killed their vision of a big blue sky with a waving American flag.)