faiblug / setiframeheight Goto Github PK
View Code? Open in Web Editor NEWcross-domain responsive iframes: automatically set iframe height to fit iframe content
Home Page: https://demo.jonasfischer.net/Faibl/setIframeHeight/
License: MIT License
cross-domain responsive iframes: automatically set iframe height to fit iframe content
Home Page: https://demo.jonasfischer.net/Faibl/setIframeHeight/
License: MIT License
I installed the lib as explained but never triggers that event, that when the content in the iFrame reduces the iFrame doesn't change his height and keeps the higher height.
I manage to make it work for me changing the following part marked on bold on the file "set-iframe-height-child.js":
function getDocumentHeight() {
var D = document;
var b = $('body');
var matches = navigator.userAgent.match(/MSIE (\d)/);
if (matches && parseInt(matches[1], 10) <=10) {
return Math.max(D.body.scrollHeight, D.documentElement.scrollHeight);
}
return Math.min(
Math.min(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.min(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
)
);
}
Can you tell me what I'm doing wrong? Or actually, is an issue?
Thanks
I'm using 1.3.0 and i'm getting a weird issue where everything works but in my Chrome console i'm getting the error "Uncaught TypeError: t.indexOf is not a function". In fact when I open the Chrome console on the demo page https://demo.jonasfischer.net/Faibl/setIframeHeight/ I get a similar error referring to line 164 "if (data.indexOf('::')) {". I'm not a javascript guru. any ideas what's going on here?
This doesnt work on Firefox and IE as expected. It increases the height of the iframes, but doesnt decrease them. Is there something that needs to be done?
The dist files are minified but are not suffixed as such. E.g. set-iframe-height-min.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.