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 not changing when window is resized (stays at shrink state and not expanding)

See original GitHub issue

A parent page, let’s say, www.maingames.com has an iframe page happywheelsgames.com and loads perfectly using this plugin. The frame page has a modal inside, and changes the body height in every click of the anchor links inside (just doing show and hide here displaying lists and grid of data).

However, the problem occurred when the user loads the site, in minimized window (not full screen), then opens the modal (and also after they closed it), and maximizes the browser window, it stays on its “shrink” state and not expanding the whole iframe like it used to.

Here’s my code:

var windowHeight = window.innerHeight || document.documentElement.clientHeight;
var headerHeight = $(".header").outerHeight();
var footerHeight = $(".footer").outerHeight();
var contentHeight = windowHeight - (headerHeight + footerHeight);

$("iframe.gamesData").on("load", function() {
  $(this).iFrameResize({
    heightCalculationMethod: 'max',
    minHeight: contentHeight
  });
});

I also tried using lowestElement and taggedElement but it’s not resizing even on the loading of the page. I also tried inserting another iFrameResize function inside a “$(window).on(“resize”, function ()” but it returns a warning saying something like “iFrame already setup. Ignore [FrameName]”, and not actually resizing. I believe there’s already a “resize” function inside the plugin, pls correct me if I’m wrong.

Any suggestion or piece of advice is very much appreciated. iframeresizer-issue

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ltkhuong7commented, Dec 20, 2016

I am sorry, your IFrameResizer has been fine. I have found out a problem from my javascript. It conflicts with yours.

0reactions
davidjbradshawcommented, Dec 19, 2016

If you can create a simple test case I will have a look. Expect their might be some race condition happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Height 100% not working properly while resizing browser
It works fine while the browser is maximised. But when it is resized my div is not rendered properly. My problem is when...
Read more >
resize - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The resize CSS property sets whether an element is resizable, and if so, ... The element offers no user-controllable method for resizing it....
Read more >
Make controls stretch, shrink, or move as you resize a form
The control is anchored to the upper-right corner of the form, and does not change size. Stretch Down and Right. The control is...
Read more >
Implement responsive aspect ratio on window resize ... - Daily.co
It may also need to update its size as a window is resized or to ... So far, though, the height only gets...
Read more >
Advanced cropping, resizing, resampling - Adobe Support
Pixel dimensions: The width and height of the image. ... When you resize an image and do not resample it, you change the...
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