Results 1 to 7 of 7

Thread: iframe question

  1. #1
    Join Date
    Aug 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question iframe question

    Hi,

    I'm new to this forum so apologies if this has been answered before, I have looked but didn't find anything.

    I am writing a website that needs to use iFrames, I know there not great but the system runs off a bid MySQL database which then feeds several websites hence the reason i need them.

    The issue I have is being able to alter the height of an iframe via a hyperlink.

    The site address is http://www.smovemovedemo.co.uk , this is my work in progress site so it's a bit messy I’m afraid.

    The index page center frame calls the different pages via iframe tags. The first page also sets the default centre iframe height to be around 900px.

    What I need to be able to do is when the show ads ( bottom left ) link is clicked the hyper link calls a new page and places it in my centre frame. The problem is this page is built from the database and shows houses for sale. When the page is put together the height is around 300px taller than the default so i need to change the height on the fly for different pages.

    The code for my first page is

    <iframe Name="centremain" FRAMEBORDER="0" HEIGHT="898" WIDTH="708" src="http://www.smovemovedemo.co.uk/mainpagecontent.htm"></iframe>

    The code for the hyper link is

    <A HREF="http://www.smovemove.co.uk/estate/cgi-bin/mojoEstate.cgi?type=search&action=search&cat_c=0&min_property_price=0&max_property_price=100000000&cat_a=&submit.x=27&submit.y=24" TARGET="centremain" title="text by rod">show ads</a>

    Is this possible ??. I have looked at various Java Script solutions but they don't seem to work via a hyperlink.

    Any help would be appreciated as I have been working on this for 3 days now and it's getting frustrating.

    Thanks.... Pigsfoot

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You need to adjust the height of the Iframe using some JavaScript code. It is not possible to have a 100&#37; height for Iframes.

    Please have a look at this script available in this site Iframe SSI II and integrate the script as it needs based on its documentation.

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    if you are using a database chances are your site supports some type of server-side language (PHP / ASP) If that is the case I would suggest you might look into redesigning your site using a server-side program, and you will not have to worry about the iframe.

    the drawback for using frames in general is that they are very hard to bookmark, so if anyone were to go to your site and scroll through a bunch of links to get to 1 portion and try to bookmark it, the next time they returned, they would be brought back to the beginning page, which as you can probably see causes them to re-find what they were intending to bookmark.

  4. #4
    Join Date
    Aug 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Nearly There

    Thanks for your help Code Exploiter.

    I have tried the code and it part works. When calling pages from within the same domain it works very well. Unfortunately the page i am having trouble with is called from another domain that hosts the database and all the main pages.

    The website does say this code will not work with external pages from another domain.

    So thanks for your help but i need to go that bit further and call a page from another domain.

    One thing this code does do is automatically resize the page which is cool... but i don’t need to be that cleaver, all i want to do is fix the height of a page in px's when calling a page from another domain to view within an Iframe.

    At least it shows it's possible.

    Thanks....Pigsfoot

  5. #5
    Join Date
    Aug 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    BoogyMan, thanks for your input.

    I understand what your saying but it is very unlikely that anyone would want to bookmark a page. Basically the site is an estate agent portal which is fed information from my main site, www.smovemove.co.uk. The idea is to be able to display property on the mini sites by a specific estate agent hence why the data is called from my main site with the database running.

    Cheers...Pigsfoot

  6. #6
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

  7. #7
    Join Date
    Aug 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the update but i still get the same problem. Because i need to display a page from a different domain the dynamic resize dosn't work.

    I think from looking round and the way Javascript works it dosn't look like it is possible.

    Thanks for you help...Pigsfoot

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
  •