Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > resize iframe according to content

Reply
Thread Tools

resize iframe according to content

 
 
Zarkas
Guest
Posts: n/a
 
      06-13-2010
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?
 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      06-13-2010
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)

--
sm
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      06-13-2010
Zarkas wrote:

> 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
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$(E-Mail Removed)> (2004)
 
Reply With Quote
 
Zarkas
Guest
Posts: n/a
 
      06-13-2010
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


On 13 Jun., 16:05, Thomas 'PointedEars' Lahn <(E-Mail Removed)>
wrote:
> Zarkas wrote:
> > 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
> --
> Danny Goodman's books are out of date and teach practices that are
> positively harmful for cross-browser scripting.
> *-- Richard Cornford, cljs, <cife6q$253$1$(E-Mail Removed)> (2004)


 
Reply With Quote
 
SAM
Guest
Posts: n/a
 
      06-14-2010
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".

--
sm
 
Reply With Quote
 
Sean Kinsey
Guest
Posts: n/a
 
      06-15-2010
On Jun 14, 10:09*am, SAM <(E-Mail Removed)>
wrote:
> 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 ?


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?
 
Reply With Quote
 
SAM
Guest
Posts: n/a
 
      06-15-2010
Le 6/15/10 1:37 PM, Sean Kinsey a écrit :
> On Jun 14, 10:09 am, SAM <(E-Mail Removed)>
> wrote:
>> 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 ?

>
> 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.

--
sm
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      06-16-2010
In comp.lang.javascript message <be99badb-99e0-409e-b997-fcafc5769b45@x2
1g2000yqa.googlegroups.com>, Tue, 15 Jun 2010 04:37:20, Sean Kinsey
<(E-Mail Removed)> posted:

>On Jun 14, 10:09*am, SAM <(E-Mail Removed)>
>wrote:
>> 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 ?

>
>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.


--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk BP7, Delphi 3 & 2006.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
NOT <URL:http://support.codegear.com/newsgroups/>: news:borland.* Guidelines
 
Reply With Quote
 
Eric Bednarz
Guest
Posts: n/a
 
      06-17-2010
Dr J R Stockton <(E-Mail Removed)> writes:

<SMUGENTRY>

> 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.

 
Reply With Quote
 
Zarkas
Guest
Posts: n/a
 
      06-17-2010
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resizing iframe height according to its content in firefox visu Javascript 3 03-01-2007 02:28 AM
Possible to resize an Iframe to its content's height? wolfing1@gmail.com Javascript 1 03-24-2006 08:06 PM
wxPython: how to update a panel content/layout according to a variable content Lo?c Mah? Python 2 11-29-2004 01:35 PM
How To pop content into bottom IFrame from top IFrame nc Javascript 0 08-10-2004 01:19 PM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM



Advertisments