tags:

views:

27

answers:

4

Hey there. I want to ask u how to make an iframe resizing when parent div is resizing. I think that I shoud use alsoResize, but i don't know if itll work with frames. Any help will be appreciated!

A: 

You will have to create a javascript function in the onload of the iframe to set the .height and .width of the iframe to that of its parent as far as i'm aware for when it first loads and then on the resize event of your parent element you will have to set it again for further resizing.

Byron Cobb
I have to resize this iframe. It has to be like the iframe in jqueryUI's dialog. If I create a function itll work only the first time. The best way will be with alseResize parametr but i dont know how to use it with iframe.
BuggyGeek
Just set the iframes body height in the stop event of the resizable - ill post another answer below.
Byron Cobb
A: 

Why can't you just have this CSS:

iframe {
 width: 100%;
 height: 100%;
}

so that it will eat all space left by its container?

rFactor
Doesn't work. Parent div is resizing but the iframe remains with the same dimensions. I also tried to set width and height parameters in the <iframe> tag which didn't work too.
BuggyGeek
A: 
$("#DIV").resizable({
                     start: function () {},
                     stop: function () {
                                $("A DIV or Body Tag Inside the IFRAME").height($("#DIV").height());
                            }
});
Byron Cobb
It doesn't work. I don't know why. I do everything right.
BuggyGeek
I'm off for the night - post your code and i'll have a look in the morning if you still havent found an answer.
Byron Cobb
A: 

Hi Buggy, I think the same problem has been encountered by other people in stacoverflow previously. Please check out this thread : Resizing IFrame with JQuery UI

xar
Yes I saw that but rFactor's solution is the same. It didn't work.
BuggyGeek