Comments (14)
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.
Also have tried clearing FireFox's cache? I think that error is version 2.2.3 being cached.
from iframe-resizer.
Arggh, I feel like an idiot. That fixed it. Works 100% now, thank you!
from iframe-resizer.
Cool np :)
D.
PS would be grateful if you would click the star button in the top right of this screen.
from iframe-resizer.
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.
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.
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.
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.
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.
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.
Well **** I'm slow, you've already implemented that two days ago. Brb.
from iframe-resizer.
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.
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.
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)
- Example page not working HOT 3
- Library removes height:auto inline style from html and body elements HOT 1
- Iframe Didn't work properly when added a class to hide some text. HOT 1
- How can I use "autoResize" option dynamically. It's not working as expected. HOT 3
- How can I write a test to test what happens when iframeresizer onMessage is invoked? HOT 1
- How to use this in SvelteKit? HOT 2
- wrong files version in js folder for 4.3.6
- Undocumented option `warningTimeout`
- Logo Design
- Feature request: add optional offset argument to moveToAnchor method HOT 4
- Trigger iframe-resizer to resize HOT 1
- How to integrate with nuxt3? HOT 2
- Time overhead when adding many elements under a same HTML element HOT 4
- i am having button inside iframe . how can i detect button click event HOT 1
- Scroll to element on AJAX request not working in child page even with scrolling set to yes HOT 1
- BREAKING🐞: `v4.3.9` release breaks usage of `.min.js` file from CDN HOT 5
- Scrolling may make the page jump to the left HOT 4
- [Feature Request] Add onResizeError callback HOT 4
- Value for minHeight can not be greater than maxHeight HOT 1
- Extra padding in Safari (macOS) 17.3 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iframe-resizer.