最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - auto-size iframe cross domain - Stack Overflow

programmeradmin0浏览0评论

I am making a web widget using iframe and javascript and i would like to make my iframe resizable to it´s content (which is loaded from other domain).

I have done some search(inclusive here at StackOverflow) and i find a couple of topics but i couldn´t find any conclusions about this issue.

Is this possible or not?

Because atm i have to set my iframe height to the maximum height of the content which in some steps of my widget gives a big white space at the bottom which dont look very good.

Note all the interactions inside the widget iframe are done pletely with ajax. (The iframe src is just one html page).

I am making a web widget using iframe and javascript and i would like to make my iframe resizable to it´s content (which is loaded from other domain).

I have done some search(inclusive here at StackOverflow) and i find a couple of topics but i couldn´t find any conclusions about this issue.

Is this possible or not?

Because atm i have to set my iframe height to the maximum height of the content which in some steps of my widget gives a big white space at the bottom which dont look very good.

Note all the interactions inside the widget iframe are done pletely with ajax. (The iframe src is just one html page).

Share Improve this question asked Oct 18, 2010 at 11:28 brpazbrpaz 3,6689 gold badges49 silver badges77 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

Take a look at this :) Also you could use postMessage - there is a crossbrowser jQuery plugin.

Hand-coding the postMessage stuff yourself is a walk in the park. You don't need a framework to do it for you. Here is an easy example on stackoverflow: cross-domain iframe resizer?

发布评论

评论列表(0)

  1. 暂无评论