SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery resize Iframe

    Hey guys,

    Really need some one in the know to help me out.

    Basically I created a nice Jquery function to resize a window to the content on an Iframe. Because the Iframe has PHP in it which pulls a list of stockists and Iframes dont Auto resize to fit its contents if it pulls extra info.

    So the code is as follows.

    Code JavaScript:
     
    $(document).ready(function(){
     
    	var iheight = $(document).height();
     
    	$('#dynamIframe', window.parent.document).attr('HEIGHT', iheight);
     
     
     
    });

    So this bit of code is embedded into my Iframe, all its suppose to do is get the documents (the Iframe's) current height then it selects the parent document ( the one containing the Iframe ) then it basically adds the height to the attributes.

    THE PROBLEM: It works great, the first time you use it. BOOYAKASHAA. However when you click a another stockist on the list. A smaller list for example... it keeps the height of the document really big. So it initially makes the space bigger to accomadate the list. But does not go smaller afterwards?

    See it mess up

    here -> http://justcrisps.co.uk/stockists.php

    Please advise!!

    Cheers in advance!

  2. #2
    SitePoint Member
    Join Date
    May 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *bump*


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
  •