Resize an iframe from another domain in multiple ways
Copy the repo into your disk.
$ git clone https://github.com/aaronpan/iframe-resizer-demo.git
Then play with the source files under the repo's demo* directories.
- Subdomain iframe resize
- Use postMessage
- Web proxy for cross-domain iframe resize
- Use iframe-resizer library
a.html in domain sub1.aaron.com.
b.html in domain sub2.aaron.com.
a embed b
This demo only works for subdomain cross-iframe.
a.html in domain domain1.com.
b.html in domain domain2.com.
a embed b
Use HTML5 postMessage.
Support: Internet Explorer 8, Firefox 3, Opera 9, Chrome 3和 Safari 4.
a.html and c.html in domain domain1.com.
b.html in domain domain2.com.
a embed b b embed c
a.html in domain domain1.com.
b.html in domain domain2.com.
a embed b
Dependency free, IE8+
MIT