HOw do we resize the parent page from inside an iframe?

P

Paul

HI! I need to know how we can resize the parent window from inside an
iframe?

I have a script that works great in IE, NS, Opera. but with firefox/mozilla
it does not work completely due to a bug ( I think in these browsers.

I posted a work around here yesterday for auto- resizing iframes for
firefox. but the workaround has a side effect which for is no good for my
situation.

I notice that firefox/mozilla does not accept Auto-height for the body tag
in CSS. the other browser above do auto resize body after the script has
resized the iframe.

I noticed also that if you use your mouse to adjust the browser size it then
its works as firefox will then auto adjust the screen size. (This I think is
bug in Firefox/mozilla).

So I figure that if I resize the window ( Just one Pixel ) then back to its
original size it would simulate the user re-adjusting the browser window.
that's why I am asking for a way to resize the parent window from within the
child window of the iframe, It would right after the script has resize the
parent Iframe.

NOTE: A page refresh is no good for me. I already thought of that but I cant
use it for another reason.
Thanks in advance :)

Paul
 
S

Steve Easton

Google for javascript: resizeto(x,y) and google for onblur()

You will have to create global javascript variables and a function
in the parent page, and then come up with a way to trigger the function
from the iframe

I'm thinking a call to onblur from the Iframe could call the function in
the parent window.



--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul

Thanks for the response. why is the onblur() needed if I put the function to
resize in the parent?

Paul
 
R

Ronx

FireFox has option settings that prevents JavaScripts moving/resizing
of windows, disabling/replacing context menus, and other common
operations.
In FireFox, use Tools->Options->Web Features and click the Advanced
button.
 
S

Steve Easton

It might not be needed

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul

HI! I got a script and modified it . can you take a look at it and tell me
whether I should put this in the child pages that go into the iframe or the
parent that holds the iframe.?

How should I call it? I guess it would have to go after the script finishes
in the child page so that resizes script resizes the parent then after the
script will so a simulated refresh. am I correct to assume this?


Paul
 
S

Steve Easton

If you want to resize the parent, the script needs to be in the parent.

Then create an event in the child that calls a function in the parent.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
P

Paul

Ok Thanks, I will try that :)


Paul
Steve Easton said:
If you want to resize the parent, the script needs to be in the parent.

Then create an event in the child that calls a function in the parent.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
.......................with a computer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top