Results 1 to 4 of 4

Thread: IE iframe handling

  1. #1
    Join Date
    Jan 2006
    Location
    Derbyshire, UK
    Posts
    74
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default IE iframe handling

    I'm using an iframe (id="screen") to deliver various pieces of content and I have an image link that uses target="screen" to return the iframe to the original menu.

    It works fine in Chrome & Firefox but not in IE8 or 9.

    Any clues as to why and how to combat it will be greatly appreciated, you can view the page here...

    http://www.13ill.com/iphone/
    Last edited by Burgin; 10-01-2011 at 02:03 PM. Reason: clarity

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The target attribute is for the name attribute of the iframe, not the id. Or at least that was how it was originally. Or maybe that was only ever in IE.

    In any case, those other browsers will recognize targeting the iframe by its name. And if you still need the id - say for styling the iframe from a stylesheet, you can use both.

    To make a long story short, add the highlighted:

    Code:
    <iframe id="screen" name="screen" src="apps.htm" width="211px" height="297px" scrolling="no"></iframe>
    Ah, I see you already did, and it's working in IE. I'm marking this thread resolved.

    But let us know if you're still having problems.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Location
    Derbyshire, UK
    Posts
    74
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    Yes I did try adding name="screen" before I posted and it still didn't work in IE 8 but didn't try it in IE9

    Thanks

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You may just need to refresh the page and/or clear the browser's cache.

    Works here in IE 9. And sort of in IE 8. The transition is very unsightly, but works. Looks like you need to hide it while it's updating/loading. At least for that browser. Something like add to the click event .css({display: 'none'}), .css({visibility: 'hidden'}), or a .hide() for the iframe. Then have the iframe's onload event do the reverse.

    That or if possible get rid of whatever is causing the distortion of the size of the iframe while the new content is loading. Do you have some sort of auto resizing code for it? If so, that might be the culprit.

    Anyways, as I say, it is loading in those browsers, looks good in IE 9, choppy transition in IE 8. The transition back to the original screen is fine. Clicking the JamCam or Radio Stations! icons, for instance causes the distortion as things load. Perhaps preloading images might help? And until the initial screen is cached, it loads at the bottom momentarily then slides in from the upper left on 1st page load.
    Last edited by jscheuer1; 10-01-2011 at 06:02 PM. Reason: add detail
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Burgin (10-04-2011)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •