resize iframe according to content

Discussion in 'Javascript' started by Zarkas, Jun 13, 2010.

  1. Zarkas

    Zarkas Guest

    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?
    Zarkas, Jun 13, 2010
    #1
    1. Advertising

  2. Zarkas

    SAM Guest

    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
    SAM, Jun 13, 2010
    #2
    1. Advertising

  3. 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$> (2004)
    Thomas 'PointedEars' Lahn, Jun 13, 2010
    #3
  4. Zarkas

    Zarkas Guest

    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 <>
    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$> (2004)
    Zarkas, Jun 13, 2010
    #4
  5. Zarkas

    SAM Guest

    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
    SAM, Jun 14, 2010
    #5
  6. Zarkas

    Sean Kinsey Guest

    On Jun 14, 10:09 am, SAM <>
    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?
    Sean Kinsey, Jun 15, 2010
    #6
  7. Zarkas

    SAM Guest

    Le 6/15/10 1:37 PM, Sean Kinsey a écrit :
    > On Jun 14, 10:09 am, SAM <>
    > 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
    SAM, Jun 15, 2010
    #7
  8. In comp.lang.javascript message <be99badb-99e0-409e-b997-fcafc5769b45@x2
    1g2000yqa.googlegroups.com>, Tue, 15 Jun 2010 04:37:20, Sean Kinsey
    <> posted:

    >On Jun 14, 10:09 am, SAM <>
    >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
    Dr J R Stockton, Jun 16, 2010
    #8
  9. Zarkas

    Eric Bednarz Guest

    Dr J R Stockton <> 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.
    Eric Bednarz, Jun 17, 2010
    #9
  10. Zarkas

    Zarkas Guest

    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.
    Zarkas, Jun 17, 2010
    #10
  11. Zarkas

    SAM Guest

    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
    > <> posted:
    >
    >> On Jun 14, 10:09 am, SAM <>
    >> 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);


    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).
    --
    sm
    SAM, Jun 17, 2010
    #11
  12. Zarkas

    SAM Guest

    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")

    --
    sm
    SAM, Jun 17, 2010
    #12
  13. Zarkas

    Evertjan. Guest

    Zarkas wrote on 17 jun 2010 in comp.lang.javascript:

    >
    > Well, the reason I choose to use an iframe in this case


    What case?

    [please always quote on usenet]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jun 17, 2010
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lo?c Mah?
    Replies:
    2
    Views:
    1,684
    Lo?c Mah?
    Nov 29, 2004
  2. Daedalous
    Replies:
    3
    Views:
    679
    Daedalous
    Jan 16, 2004
  3. nc
    Replies:
    0
    Views:
    142
  4. Replies:
    1
    Views:
    196
  5. visu
    Replies:
    3
    Views:
    165
    totalstranger
    Mar 1, 2007
Loading...

Share This Page