iframe auto resize

杀马特。学长 韩版系。学妹 提交于 2020-01-04 09:19:19

问题


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')


回答1:


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

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




回答2:


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());
});



回答3:


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

i hope it helps.



来源:https://stackoverflow.com/questions/1189973/iframe-auto-resize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!