I am writing a signage html page to be shown in full screen automatically. I use screen.width and .height to get the client's screen size. Now for the edit page which users can add/delete contents on the signage, I would like to let users preview the edited result without going to signage site in fullscreen. So I plan to have a iframe has the same ratio as the client screen and embedded the signage page into the iframe on the edit page.
The thing is how I can let the signage page change the size to fit in the iframe? Or how I can get the parent page's iframe from the embedded page? The screen.width and $(document).width seem to have the same result.
I use python GAE, webapp2,jinja2.
var iframe = parent. document. getElementById(frameElement.id);
Yes, accessing parent page's URL is not allowed if the iframe and the main page are not in the same (sub)domain. However, if you just need the URL of the main page (i.e. the browser URL), you can try this: var url = (window. location !=
The standard size of an iframe for desktop is a width of "560" and height of "315."
Within the embedded page you can retrieve the size of the iframe
element in the parent page like this:
var width = window.frameElement.offsetWidth,
height = window.frameElement.offsetHeight;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With