1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Auto Resize iFrame

Discussion in 'HTML & Website Design' started by banadora, Jan 30, 2012.

  1. #1
    Hey guys, I'm trying to make an iFrame auto-resize to the content inside it (photo gallery). Everything is on the same domain. I read a hundred+ blog and forum posts and my eyes hurt from reading all those scripts. I tried this one:

    http://www.lost-in-code.com/programming/jquery-auto-iframe-height/

    and followed instructions to the letter and it still does not work.

    It doesn't really say where to put those scripts exactly so I assumed the parent page not the page of the iFrame (photo gallery)


    Anyone know any easier / better scripts. No CSS or anything on this site just plain HTML site made on FrontPage 2002.

    Thanks again.
     
    banadora, Jan 30, 2012 IP
  2. ketting00

    ketting00 Active Member

    Messages:
    433
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    68
    #2
    There is no such solution.
     
    ketting00, Jan 31, 2012 IP
  3. banadora

    banadora Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How about this? There's an example there...

    www[dot]dynamicdrive[dot]com/dynamicindex17/iframessi2.htm

    I tried it but with no luck. Other scripts I saw resize it again when the content is shorter. That script on Dynamic Driver only resizes it once to the longest stretch of content.
     
    banadora, Jan 31, 2012 IP
  4. ketting00

    ketting00 Active Member

    Messages:
    433
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    68
    #4
    That's javascript, not a plain HTML site. It should be easy if you know how to modify javascript to suit your specific need. For photo gallery, why don't you use lightbox instead.
     
    ketting00, Jan 31, 2012 IP
  5. banadora

    banadora Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I already decided on Plogger for the gallery since the client wants to be able to upload images from his end and not call me every other day. Basically I want to put Plogger in an iFrame and have the iFrame auto-resize to the content inside it. I'm having a very hard time figuring it out.

    Well what's the best way to do it? I know it can be done. I can PM you the link to the site I'm working on so you can take a look
     
    banadora, Feb 1, 2012 IP
  6. banadora

    banadora Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hey every one, I tried the Dynamic Drive script again and got it working... BUT only working in Internet Explorer. It is not working in Firefox 9. I haven't tried Internet Explorer 7 or 8. This script does work so I'm sure there are people out there who know the fix for this...


    Thanks again
     
    banadora, Feb 2, 2012 IP
  7. GoldSEO

    GoldSEO Member

    Messages:
    281
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    33
    #7
    auto resizing is like the most evil thing you can do. I use noscript on firefox and have iframes disabled. Figure out a way to recode your template to resize within the windowed area, do not mess with the browser itself...malware apps will hate your site forever and ever, and it will only get worse as time goes on
     
    GoldSEO, Feb 2, 2012 IP
  8. ezprint2008

    ezprint2008 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    90
    Digital Goods:
    4
    #8
    what about like some Google search showes height= "100%" width="100%"
    or nest some PHP on the Iframe height and width.

    <?php
    if($image_file == "1"){
    $iframe = '<iframe height="300" width="250">';
    }
    elseif($image_file == "2"){
    $iframe = '<iframe height="200" width="150">';
    }

    At top of page before HTML you can set up the correct Iframe through the PHP vars.
    Have thumbnails the users pick as buttons (perse) and these pass information on the image file selected to the "post" method
    and allow for the right <Iframe> set up to be called for each dynamically.

    then in the HTML page where the Iframe would exist use <?php echo $iframe; ?>
    instead of the Iframe (complete the code)

    The layout of your site would've been helpful, if you're using images as thumbnails first, or if web users are uploading them.
    Why are you using Iframes again anyway? are you yanking somebody elses content? I don't understand why you would use an Iframe to display an image on your own site.
     
    ezprint2008, Feb 6, 2012 IP