iframe auto resize

I have been desperatly searching the web for a way to auto resize an iframe. I have tried many scripts online, but most recieve a permission denied error.

Both sites are members of the same subdomain

site 1: (views iframe) sub.domain.site.ca site 2: name.site.ca

how is this done (both are members of 'site.ca')

Upvotes: 2

Views: 5899

Answers (3)

Oli
Oli

Reputation: 1692

If you are using jquery then you may put this code in the loaded page to auto resize your calling iframe :

$(document).ready(function(){
    $('#my_iframe', window.parent.document).height($(document).height());
});

Upvotes: 1

Amir
Amir

Reputation: 1259

i implemented such a solution: http://www.amirharel.com/2009/07/28/implementing-iframe-toolbar/

i hope it helps.

Upvotes: 0

Colin
Colin

Reputation: 10638

I think this is the exact answer you are looking for:

http://ofirpicazo.com/javascript/iframe-resizing-across-subdomains/

Upvotes: 2

Related Questions