resize iframe according to content

Z

Zarkas

Looking for a good crossbrowser script to resize my iframe according
to its content.
setting it to the documents offsetHeight in the frames onload event
seems to work most of the time but sometimes it a bit to short
especially if there's images on the content page.
tried the autoHeight jquery script and it seemed to work nicely, it
was just way to slow in cases, epscially if you clicked on a lot of
links quickly then it just froze the site.
any good suggestions?
 
S

SAM

Le 6/13/10 2:59 PM, Zarkas a écrit :
Looking for a good crossbrowser script to resize my iframe according
to its content.
setting it to the documents offsetHeight in the frames onload event
seems to work most of the time but sometimes it a bit to short

Does that "works" with any navigator ?
especially if there's images on the content page.

??? IE feature ?

And then anyway ?
If it is so big, that probably doesn't enter in the navigator's window
--> double lifts

tried the autoHeight jquery script and it seemed to work nicely, it
was just way to slow in cases, epscially if you clicked on a lot of
links quickly then it just froze the site.
any good suggestions?

Don't use iframes.

(for all a lot of reasons)
 
T

Thomas 'PointedEars' Lahn

Zarkas said:
Looking for a good crossbrowser script to resize my iframe according
to its content.

This nonsense has been discussed before.
setting it to the documents offsetHeight in the frames onload event
seems to work most of the time but sometimes it a bit to short
especially if there's images on the content page.

You don't want to use an iframe.
tried the autoHeight jquery script and it seemed to work nicely, it
was just way to slow in cases, epscially if you clicked on a lot of
links quickly then it just froze the site.
any good suggestions?

Don't use jQuery, and forget about the whole idea.

<http://jibbering.com/faq/#posting>


PointedEars
 
Z

Zarkas

I could see the reason not to use iframes 5 years ago when not all
browsers supported it, but why not today?
Aside from the resize problem it normally works pretty well, and is
still one of the easist ways to load dynamic content if you just want
to update a part of a page only.

-Zarkas
 
S

SAM

Le 6/13/10 4:24 PM, Zarkas a écrit :
I could see the reason not to use iframes 5 years ago when not all
browsers supported it, but why not today?

Because :
- not bookmarkable
- poor accessibility
- ugly ?
Aside from the resize problem it normally works pretty well, and is

If the resizing is not too hight, possibly.
A lot of users don't display their applications, whom browsers, in full
screen.
Not every body use a 24" monitor.
still one of the easist ways to load dynamic content if you just want
to update a part of a page only.

You can tempt do do it by Ajax (with an exit way if JS is disabled)
with same inconvenient as iframes.

But, today, the refresh/reload of a page whom a part of its content has
changed is really fast (the longer is the job made server side to
rebuild the htlm to serve, except if heavy images are sent with) and not
more with a white display between the 2 "pages".
 
S

Sean Kinsey

Le 6/13/10 4:24 PM, Zarkas a crit :


Because :
- not bookmarkable
- poor accessibility
- ugly ?

mu

All of these can easily be worked around if one chooses to. And
seriously, 'ugly'? Was that the best you could do?

For some reason it still amazes me that whenever someone even mentions
'iframe' (and a number of other things),
you ignorants reply with 'don't use it' without having the faintest
idea about the use case, the intentions, the requirements, the reason
why the person in the first place chose to use an iframe etc..

Something is seriously wrong when its the same people who pose as the
educated ones that behave as trolls. Don't you see that you are
undermining your own 'authority' by doing so?
 
S

SAM

Le 6/15/10 1:37 PM, Sean Kinsey a écrit :
mu

All of these can easily be worked around if one chooses to.

Would the OP know how to do ?
And seriously, 'ugly'? Was that the best you could do?

Horrible ! (better ?)
Don't you see that you are
undermining your own 'authority' by doing so?

For my part, I do not claim any authority.
 
D

Dr J R Stockton

In comp.lang.javascript message <be99badb-99e0-409e-b997-fcafc5769b45@x2
1g2000yqa.googlegroups.com>, Tue, 15 Jun 2010 04:37:20, Sean Kinsey
mu

All of these can easily be worked around if one chooses to. And
seriously, 'ugly'? Was that the best you could do?

For some reason it still amazes me that whenever someone even mentions
'iframe' (and a number of other things),
you ignorants reply with 'don't use it' without having the faintest
idea about the use case, the intentions, the requirements, the reason
why the person in the first place chose to use an iframe etc..

Agreed. It is very common for persons of limited education and
intelligence (many articles in Usenet are written by one of those),
knowing of one circumstance when something is inadvisable, to rant and
rave against doing that in any circumstances.

Take for example the suggestion that an iframe is visually ugly (which
seems strange in the first instance); that cannot apply to a hidden
iframe, and I have applications which would work, using an iframe, if
that iframe were invisible. And, while commerce may insist on pretty
displays, it is practicality that matters on technical pages. Also, the
content of the iframe changes too rapidly for bookmarking to be
practical.
 
E

Eric Bednarz

Agreed. It is very common for persons of limited education and
intelligence (many articles in Usenet are written by one of those),
knowing of one circumstance when something is inadvisable, to rant and
rave against doing that in any circumstances.

</SMUGENTRY>

Also, one of the better examples of recursion I have seen in this group.
 
Z

Zarkas

Well, the reason I choose to use an iframe in this case was that I got
some flash sideshow in the top of the page, and want to just change
the page content below it according to what menu field they clicked
on. If I just loaded a new page each time they clicked on a menu the
slideshow would start over and it would ruin the flow. I wouldn't call
the iframe "ugly" as you don't even notice it's there.
The only problem is that little resize problem which seems to be
pretty common and tons of way to deal with, none which I have tried
seemed optimal.
 
S

SAM

Le 6/16/10 9:13 PM, Dr J R Stockton a écrit :
In comp.lang.javascript message <be99badb-99e0-409e-b997-fcafc5769b45@x2
1g2000yqa.googlegroups.com>, Tue, 15 Jun 2010 04:37:20, Sean Kinsey


Agreed. It is very common for persons of limited education and
intelligence (many articles in Usenet are written by one of those),
knowing of one circumstance when something is inadvisable, to rant and
rave against doing that in any circumstances.

Take for example the suggestion that an iframe is visually ugly (which
seems strange in the first instance);

it's its used that is "uggly"
specially if "resizing" :-(
that cannot apply to a hidden
iframe, and I have applications which would work, using an iframe, if
that iframe were invisible.

as it was question of size why to speak of invisible ?

The used of not visible frames or iframes for JS convenience is another
problem, I don't think it was evoked in OP's question.

Also, the content of the iframe changes too rapidly for bookmarking
to be practical.

Maybe
But, once again, that didn't sound like in the question (resizing).
 
S

SAM

Le 6/17/10 9:14 AM, Zarkas a écrit :
Well, the reason I choose to use an iframe in this case was that I got
some flash sideshow in the top of the page, and want to just change
the page content below it according to what menu field they clicked

Ha! there we are ... a Flash commodity ...

Interesting ... with my Flash blocker ;-)
on. If I just loaded a new page each time they clicked on a menu the
slideshow would start over and it would ruin the flow. I wouldn't call
the iframe "ugly" as you don't even notice it's there.
The only problem is that little resize problem which seems to be
pretty common and tons of way to deal with, none which I have tried
seemed optimal.

It would be interesting to have a look inline of the job in its actual
state.

Does file(s) loaded in the iframe have a css that could fix your problem
avoiding to have to resize the iframe's space ?

Without having seen the site I continue to think that a display in a div
via Ajax could be more easily fixable (css are your friends).

Certainly, Sean Kinsey will explain you the working out about bookmarks
(since we are now talking about "menu")
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top