Giter Club home page Giter Club logo

Comments (14)

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

I've test this on FF28(Mac) and it seems to be working ok. Do you have a url you could point me at to take a look at?

Also does http://davidjbradshaw.com/iframe-resizer/example/ work for you?

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

Also have tried clearing FireFox's cache? I think that error is version 2.2.3 being cached.

from iframe-resizer.

BlastingKap avatar BlastingKap commented on July 19, 2024

Arggh, I feel like an idiot. That fixed it. Works 100% now, thank you!

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

Cool np :)

D.
PS would be grateful if you would click the star button in the top right of this screen.

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

Also you may find it works now without need to set hightCalculationMethod as I've improved the default option so it breaks less often. I'd be interested in seeing the page your using this on as I'm still trying to find out the different ways the height calculation can run into problems.

from iframe-resizer.

BlastingKap avatar BlastingKap commented on July 19, 2024

Sadly, I don't have full control over the publication so the iframe src isn't public yet. I will say that with Chrome 34, IE11 and FF28, the default heightCalculationMethod doesn't expand when jquery multiselect boxes expand: http://www.erichynds.com/blog/jquery-ui-multiselect-widget.

Otherwise the iframe resizes perfectly (hide/show/animate jquery functions mostly) with Chrome and FF. IE11 is annoying. It sizes correctly but shows vertical/horizontal scrollbars that move only a few pixels.

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

Just had a look at that widget and it uses absolutely positioned divs. I'm guessing your using documentElementOffset to deal with this. It's better at dealing with this kind of div but can over report the height by up to 16px.

For IE11, have you tried adding scrolling="no" into your iframe tag? IE for some reason doesn't allow turning scrolling off from JS...

from iframe-resizer.

BlastingKap avatar BlastingKap commented on July 19, 2024

Correct :) documentElementOffset seems to be the happy compromise. I wish I could test setting 'scrolling' in the IE tag but the parent host strips any non compliant HTML. Because 'scrolling' was removed from the HTML5 spec it gets stripped as soon as I save the iframe :(

I've ended up setting scrolling:true, all three browsers behave identically now, documentElementOffset appears to report things correctly enough that everything shrinks and expands properly without showing scroll bars. The exception is the multiselect boxes, but at least they are accessible when the size reporting is inaccurate.

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

What about doing something like this to get around the striping of the non-compliant attribute?

<div id="iFrameContainter"></div>
<script>
$('#iFrameContainer').html('<'+'iframe src='...' width="100%" scrolling="no"></iFrame>');
</script>

Does the page grow with the multiselect boxes if you use the max options? I know it won't shrink in FireFox and IE then. So wondering if it would be useful to allow you to change the heightCalculationMethod at runtime in the iFrame, so you could set it to max just before you open the multiselect and then back to bodyOffset when you close it.

from iframe-resizer.

BlastingKap avatar BlastingKap commented on July 19, 2024

Back at work and got a chance to try out your method, it worked beautifully! No more odd looking scrollbars in IE.

You're correct, max expands properly in Chrome, Firefox and IE (sadly, no shrink). Having the option to change the heightCalculationMethod dynamically would be useful.

from iframe-resizer.

BlastingKap avatar BlastingKap commented on July 19, 2024

Well **** I'm slow, you've already implemented that two days ago. Brb.

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

Just came across this on how to fix the shrink issue.

http://stackoverflow.com/questions/3053072/iframe-resizing-with-scrollheight-in-chrome-safari

Have been testing it and it does seem that doing

document.getElementById('iFrameResizer0').style.height = 'auto';

on the host page when it fails to shrink fixes it, but running it twice shrinks it too much. So currently looking at how I can work out when it should be called.

from iframe-resizer.

BlastingKap avatar BlastingKap commented on July 19, 2024

Looking forward to it! Until then, I've successfully implemented toggling the heightCalculationMethod to 'max' then back to 'bodyOffset' as you suggested, works like a charm!

from iframe-resizer.

davidjbradshaw avatar davidjbradshaw commented on July 19, 2024

Glad to hear that worked. Been playing around with and have something I'll release soon, however, this method to scale the iFrame down is a bit of a hack, as it basically forces it down to 0px and then runs the resize event to scale it back up.

Whilst it works, I have to disable the interval timer that IE8/9/10 use instead of MutationObserver, as otherwise you end resizing the frame 63 times a second.

So you will like still need to call parentIFrame.size() to trigger the downwards sizing in these browsers. For now you can likely get the same effect by doing this.

if ('parentIFrame' in window){
    parentIFrame.size(1);
    parentIFrame.size();
}

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.