Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Get height from viewport on parent to use in iframe?
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=5777
Page 1 of 1

Author:  Asle [ 18. Feb 2019, 15:52 ]
Post subject:  Get height from viewport on parent to use in iframe?

Hi,
Since your javascript does a alot and probably reads both height and width of the parent page, is is possible to get the parent viewport in a variable?

In my iframe I have a lightbox that calculates the heigth of the page to fit the image popup related to the pages height. But if the iframe is long but the viewport is short, it shows the popup outside the parents viewport.

Is there a variable I can fetch to include in my lightbox javascript for the parents viewport?

Since else I will have to do some postmessage() javascript to talk to the parent page. I thought maybe that variable is already in the Advanced iframe script?

Author:  TinyWebGallery [ 18. Feb 2019, 16:50 ]
Post subject:  Re: Get height from viewport on parent to use in iframe?

you would have to write most by yourself.

Like I have shown here:
http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/integrate-iframe-sizer-script

a custom onload can be included and then you have to process this in the iframe. There is no default post message which sends the current iframe size to the iframe. The script is intended to get the height from the iframe and then set it on the parent the correct way.

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/