Giter Club home page Giter Club logo

Comments (11)

davidjbradshaw avatar davidjbradshaw commented on August 19, 2024

Have you tried it with the default options?

The constant resizing is caused by CSS causing the content to be always bigger than the page. The simple example is setting the body height to 101%, which creates a loop where the CCS changes the content size whenever their is a frame resize and this intern causes a page resize. If you use absolute positioning then this is an easy trap to fall into and IE is more sensitive to it.

I'm currently working on a tolerance option, so that you can set a value and the page has to resize more than that before it triggers a resize.

Currently the position thing you could do by using the sendMessage function to send back a message to the parent page asking it to reposition itself. I have being thinking about adding a parenteIFrame.scrollTo([x,y]); functions, as the code to reposition the host page is already in the library as it calls it when it does the double resize to workout if the frame has reduced in size, in the hieghtCalculationMethods that don't by default downsize.

from iframe-resizer.

michaelflip7 avatar michaelflip7 commented on August 19, 2024

I tried it again with the default options, and I ran into the issue where the frame wouldn't downsize if the heightCalculationMethod wasn't set to 'max'. Though, with that being said, the flickering was completely gone.

If I keep heightCalculationMethod: 'max' and reset interval, to default, the flickering is gone, but some pages continue to grow endlessly in IE. Which, is better than the flickering, so I could settle with this if there's no fix

As for the re-positioning, that would be cool. I'll use sendMessage until then!

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on August 19, 2024

The problem is that some sizing methods just don't downsize, so to work around that, I reset the height to the default height and then grow the iFrame again. This is a hack to get around a bug in some browsers.

To avoid the the flicker, whilst still having downsizing you need to use bodyOffset or lastElement as the sizing method. The first one is easy to break with CSS and the later one crawls in old IE.

My suggestion is to either use lastElement in modern browsers with a fall back to max in old IE. Or go with bodyOffset and debug your CSS.

from iframe-resizer.

michaelflip7 avatar michaelflip7 commented on August 19, 2024

Unfortunately, I have little control over the CSS inside the frame, I find that using 'max' in all browsers gives me an overall decent experience with the only problem being the page ever-expanding in older versions of IE, which I can live with.

Though, the fallback option sounds interesting, how would I go about setting the fallback to X?

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on August 19, 2024

Just looking at that page a little more and their is something very odd about it. I put the frame inside my test page and I just don't see the body shrink with the content in any browser.

The fallback approach is to pass a different sizing method to iframeResizer() depending on which browser your in. That said when you fall back to bodyScroll it fails to resize at all in IE8.

Somethings borked with the CSS on that page and it's not jumping out at me what it is right now. One thing I would try is to strip all the unneeded attributes from the body tag and see if that has any effect.

I'm going to close this for now, as I don't see this as a bug in my code. I'll let you know when I ship the next version with the parentIFrame.scrollTo() in it.

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on August 19, 2024

PS I'm sure your not the first person to run into issues trying to include code from latesttraveloffers.com.

from iframe-resizer.

michaelflip7 avatar michaelflip7 commented on August 19, 2024

After some experimenting, setting autorefresh to false works rather nicely. The pages don't seem to expand endlessly in IE, and things work relatively well. Yeah, the latesttraveloffers.net booking engine was made a long time ago, and it gives me a ton of headaches!

Cheers for the help and keeping me posted on the new version!

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on August 19, 2024

So what was the final set of options you came up with? So I can point the next person who asks about that site to this issue. ;)

from iframe-resizer.

michaelflip7 avatar michaelflip7 commented on August 19, 2024
                heightCalculationMethod : 'max',
                autoResize              : false,    
                checkOrigin             : false,

Using version 2.5.0

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on August 19, 2024

Thanks.

from iframe-resizer.

andreyvolokitin avatar andreyvolokitin commented on August 19, 2024

Dealing with the same issue here. IE9+ working fine with autoResize: true. But in IE8 iframe height is constantly increasing. autoResize: false solves this, but what if we actually need autoResize: true? As far as I understand when we set autoResize: true iframe is resizing automatically when we make changes to the iframe DOM. This seems like very common need, so I am wondering if this can be solved without needing to set autoResize: false.

I also found that this CSS inside iframe can cause this issue:

html,
body {
    height: 100%;
    }

But I think this is valid CSS and in the perfect world it should not cause issues like this...

from iframe-resizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.