question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Height calculation wrong

See original GitHub issue

Hi,

I implemented your library in my code, but the height calculation is wrong.

I have a content page with a largest content, but when it is loaded by the iframe it has a wrong height (my content page has 1700px of height and the iframe load with 150px).

Also every time an action is triggered (click, focus, etc) my iframe decreases the height until it arrives to zero.

I put the two scripts in the last version on my pages, and i tried to resolve this problem with some options, but i could not do this. Can you help me?

My code is that:

<iframe id="rightNow" src="https://phooto-br.custhelp.com/app" scrolling="no" onload="iFrameResize({
				log: true,
				enablePublicMethods: true,
				contentWindowBodyMargin: 0,
				heightCalculationMethod: 'scroll'
			})"></iframe> 

I have some prints of my console:

print1

print2

Here is when my iframe detects an action and triggered it, decreasing the height: print3

If you can help me, I would be grateful. Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
davidjbradshawcommented, Dec 11, 2018

Make sure you have a valided <doctype /> and then check your CSS does not overflow the bottom of the page. Height calculation issues always come down to one of these two things

0reactions
ArturasMicommented, Dec 11, 2018

Having same problem. Height is always set to 150px and I tried to use ‘lowestElement’ but than height is being set to something like 100k px and when you scroll down it increases fast to 6mln px on mobile devices ( tested on samsung with android 8 and iphone x) and also it’s not really calculated correct on desktop devices, I would say it’s about 150px more than it should be and on resize it increases to ~800px more than it should be. I had similar issue before so I ended up using tolerance: 3. It helped somehow so I tried to use same option on current solution but no luck at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - calculated height is incorrect so background is not working
Use JavaScript to calculate the height. Don't use absolute positioning. There is no reason to use absolute positioning for your layout.
Read more >
Box3 - incorrect height calculation - Questions - three.js forum
Good afternoon, Box3 returns the wrong height when calculating. ... Y-axis is above zero, the function makes an incorrect calculation, it works well...
Read more >
Wrong Calculation for DataCard-Height
Solved: Hi, I have a form with a custom DataCard with 6 different dropdowns. Some dropdowns are only shown if a specific value...
Read more >
Form not displaying properly. Wrong iframe height calculation
Re-embed your form using the following iframe code with 2683px height, this should cover the entire form once they are shown through condition....
Read more >
Solved: Negative and Inaccurate Height (DSM-DTM) Calculate...
Solved: Hi there! I'm trying to calculate vegetation height from drone imagery based off the DSM and DTM generated in Drone2Map.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found