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

External auto-height workaround not working [SOLVED]
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4174
Page 1 of 1

Author:  Europhoric [ 16. Nov 2016, 01:38 ]
Post subject:  External auto-height workaround not working [SOLVED]

I'm trying to get the external auto-height workaround to work, but having no luck. I'm not sure if it's my options or something missing on the external site in the javascript?

I added the following code in the body of the external site:
Code:
<script src="http://www.***.com/wp/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>
(actual domain below)

On the local site, I have set the option to "External" for "Resize remote iframe to content height" in the "External workaround" tab.

I have added enable_external_height_workaround="true" to the default shortcode on the page where the iframe is displayed.

Here is the URL of the local page with the iframe: http://tinyurl.com/glcas9r pass: HireD3sk4%}

I have the height set to 300 pixels by default. So when the iframe loads initially, it shows up perfectly, but as soon as I click on one of the job listings inside the iframe, it seems doesn't adjust the height of the iframe, and just shows a scrollbar instead.

I would appreciate your assistance!

Author:  TinyWebGallery [ 16. Nov 2016, 10:02 ]
Post subject:  Re: External auto-height workaround not working

Hi,

it seems to work fine with Firefox but not in Chrome.
Can you verify this.

I'll check what could be the problem in Chrome

Best, Michael

Author:  Europhoric [ 16. Nov 2016, 10:19 ]
Post subject:  Re: External auto-height workaround not working

Yes, I can confirm it works fine in Firefox and IE, but not Chrome.

Author:  TinyWebGallery [ 16. Nov 2016, 10:22 ]
Post subject:  Re: External auto-height workaround not working

The problem is that chrome cannot measure the body content correctly.
You need to specify the element you want to measure.

add

<script>
element_to_measure="#TPLayoutTbl";
</script>

before the
<script src="http://www.***.com/wp/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

I have not found the reason why the outer element returns a height of 0 - seems a chrome bug/feature ...

Best, Michael

Author:  Europhoric [ 16. Nov 2016, 10:27 ]
Post subject:  Re: External auto-height workaround not working

Ok thanks! I will give it a try.

Author:  Europhoric [ 17. Nov 2016, 02:49 ]
Post subject:  Re: External auto-height workaround not working

So we tried adding the code you suggested to the external site but it didn't seem to have any effect in Chrome.

Interestingly, it actually stopped working now in all browsers (Firefox & IE), and doesn't show the scroll bar any more either. It seems to stay stuck at a certain height.

Thanks for your help.

Author:  TinyWebGallery [ 17. Nov 2016, 12:11 ]
Post subject:  Re: External auto-height workaround not working

Just checked the code:

element_to_measure="TPLayoutTbl";

the hash is too much - it is not needed by the function I use here.

Best,
Michael

Author:  Europhoric [ 18. Nov 2016, 22:40 ]
Post subject:  Re: External auto-height workaround not working

It worked! Thank you so much for your help.

Author:  TinyWebGallery [ 19. Nov 2016, 01:56 ]
Post subject:  Re: External auto-height workaround not working [SOLVED]

Great.

Glad I could help.

do you think an error message would help if I detect a problem like this?
Because than I would add this to the next version.

Feel free to vote on codecanyon ;).

Best, Michael

Author:  Europhoric [ 19. Nov 2016, 07:18 ]
Post subject:  Re: External auto-height workaround not working [SOLVED]

Yeah I think an error message would be helpful.

To be honest, I found the entire "External Workaround" tab very confusing at first as I wasn't clear which code to use. I would split it up in sub-tabs, for either Subdomain or External site. I feel this section can be simplified a lot to make it easier to understand as it feels very overwhelming and confusing (even for me as a experienced developer).

It took me over an hour to even realize I had to add a javascript on the external site as this wasn't clear to me until I read some of the support tickets. It would be great to have something like "step 1: add code on external site, step 2: add this line to the shortcode...", etc.

Thanks again for your help.

Author:  TinyWebGallery [ 20. Nov 2016, 08:35 ]
Post subject:  Re: External auto-height workaround not working [SOLVED]

I check how to improve this.

Because

1. Add the following Javascript to the external web page you want to show in the iframe (The optimal place is before the </body> if possible. Otherwise put it in the head section. NEVER place it just after the <body> as than the height of the script element would be measured!):

<script src="http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

2. Check if the wordpress site url (var domain=) in this file points to your wordpress root. Click here to open this file and check the variable domain at the top. If the url is not o.k. please set the correct url in the file ai_external.template.js. If the file can not be created please change the permissions of this folder.
3. Add enable_external_height_workaround="true" to your shortcode! This is needed to disable the settings with the for the same domain.
4. Enable the workarounds you want to use below.

Is what you asking for and this is the existing text.

Best, Michael

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