Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10

Thread: Iframe question

  1. #1
    Senior Member ravensjeff's Avatar
    Join Date
    Aug 2007
    Location
    Maryland
    Posts
    125
    Member #
    15751
    So I'm working on a website for a realtor client and she is using a third party MLS search module that embeds into the agent site via Iframe. (This is how the third party provider tells you to install it...not my choice).

    My problem is this...the iframe sometimes displays about 800 pixels (tall) of information, such as when it displays the search form. Other times it displays up to 3500 pixels of information, such as when it displays listing information.

    So, I have embedded the iframe as so:

    <iframe src ="path/to/module" width="730px" height="100%" frameborder="0" scrolling="no"></iframe>

    As you can see, I'd prefer to not have the module scroll, if possible. So the problem becomes, how do I get the page to render appropriately depending on how big the iframe is?

    When set as I have it (height="100%"), the iframe natural fills the containing div as it should. But I cannot get my containing div to expand with the content. I've tried all the css properties I can think of for the containing div.

    I can set the iframe to a fixed pixel height (i.e. 3500 px) and the container will expand to that height. But that just leaves me with a lot of blank whitespace when the iframe is only displaying 800 pixels.

    Any suggestions?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    This might be a case where you should use a <table> instead of a <div>
    for just the part that needs to expand with the <iframe>.

    Tables are better at automatically resizing than divs are.

    I know, I know ... don't use <table> ... but try it and see what happens.
    If it works properly (which I think it will), I would do that ... it will save you
    many hours of frustration.

    If you were able to show us the URL, I might be able to better grasp the idea.


  4. #3
    Senior Member ravensjeff's Avatar
    Join Date
    Aug 2007
    Location
    Maryland
    Posts
    125
    Member #
    15751
    Thank you for the reply. I tried the table but it doesn't seem to want to expand either.

    Here is the URL.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    I don't think it can be done.
    I found a lot of discussion on this topic, but everyone fails.


  6. #5
    Senior Member ravensjeff's Avatar
    Join Date
    Aug 2007
    Location
    Maryland
    Posts
    125
    Member #
    15751
    Yeah that's kind of what I'm gathering.

    I have emailed the third party provider...I'll see what they say about it. I can't be the first one that has brought this up.

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    If somehow they ( http://www.mlsfinder.com/md_mris/dianacarlson )
    would allow you to use your own form, query their database, and get
    back the results in the format of an XML file, you could do it without an
    <iframe> ... but I'm guessing they won't be doing anything for you.


  8. #7
    Junior Member
    Join Date
    May 2008
    Posts
    1
    Member #
    16885
    Jeff, if you want to advoid an iframe mlsfinder dot com has the ability to wrap the header and footer onto the link provided to you. They do this with a server-side file include and it is reasonably simple. The body of the page, in this case the IDX search solution, simply “calls” the header to go above it and calls the footer to go beneath it. These header and footer files will reside on the same web servers as your website. You simply need to provide the URLs, or web addresses, for the two files hosted on your servers. An example can be seen here http://www.mlsfinder.com/in_mibor/sc...pold/index.cfm

    If you contact their service department (service@mlsfinder.com) they should be able to provide you with further instructions and any costs associated.

  9. #8
    Senior Member ravensjeff's Avatar
    Join Date
    Aug 2007
    Location
    Maryland
    Posts
    125
    Member #
    15751
    Awesome...that is a much better solution. I emailed my sales rep yesterday but didn't hear back. Thanks so much for the info...I'll definitely look into it.

  10. #9
    Junior Member
    Join Date
    Jun 2008
    Posts
    4
    Member #
    16935
    Does the height of the iframe source vary based on the iframe url? If so, you could dynamically output the iframe section of code with different height values in pixels.

  11. #10
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Only if you're willing to hardcode the heights, which is prone to breaking whenever the other site changes.

    However, you can put an onLoad handler on the iframe so that, when it loads, you run some code that will read the page's height (e.g., [minicode]document.getElementById('frame').window.outerHeigh t[/minicode]) and set the iframe height appropriately. This is hackish, but I have seen it done (in that hackjob that we call the Sakai `collaboration and learning environment') and it works more or less effectively if iframes are really the way you want to go. There are always flashes while the page loads, though, during which you get scrollbars (or you don't, but the entire content isn't visible).


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:06 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com