Search code examples
htmliframeresizetransformscale

How can I scale the contents of an iframe?


I've got an Adobe Edge JavaScript and CSS3 animation's EdgePreload HTML page included in another page, using the iframe tag. It works nicely, but when I try to use -webkit-transform:scale(0.5,0.5), the iframe itself scales from being 1600 x 900px, to 800 x 450px, but the contents remain the same size. I would post a link to the file, but it's currently offline. If you need any other information, please say so.


Solution

  • On transformation is the IFrame getting relaoded?..if not that is the issue for not resizing.. the contents are aligned based on load iframe size. Please try to relaod the Iframe after you transform..

    If a relaod is impossible might have to explicitly access Iframe DOM and resize content in that case CROSS DOMAIN POLICY will come into play and will be tedious..