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

Get PARENT height to use inside IFRAME
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=5662
Page 1 of 1

Author:  Asle [ 3. Jan 2019, 12:45 ]
Post subject:  Get PARENT height to use inside IFRAME

Hi, I have a lightbox in the IFRAME using this plugin: https://www.lokeshdhakar.com/projects/lightbox2/ which supports responsive resizing og the popup image.

Since the IFRAME is on another domain I have to use the postMessage() function. Is there some way with your plugin to get the parent height and use it in my lightbox js or do I have to write my own function for that? I have tried to find out since the settings for Advanced iFrame has so many options.

The lightbox.js gets the values like this:
Code:
windowWidth    = $(window).width();
windowHeight   = $(window).height();


I need mostly the height. Now it only gets the iframe height since this is not allowed cross-domain:
Code:
$(parent.window).width();

Author:  TinyWebGallery [ 5. Jan 2019, 22:48 ]
Post subject:  Re: Get PARENT height to use inside IFRAME

You can do this like described here:
http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/integrate-iframe-sizer-script
but this is mostly coding you have to do by yourself...

You also can pass the height/ width in the url?

Best, Michael

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