I was having problems with Lightbox iframes under IE9. Not only the lightbox but the top page would randomly change layout when moving the mouse. As this didn´t happen with Developer Tools open it was really hard to debug.
respondjs doesn´t apply to IE9 (IE8 and below) but I ended up finding the solution in their git page.
Internet Explorer 9 supports css3 media queries, but not within frames when the CSS containing the media query is in an external file (this appears to be a bug in IE9 — see https://stackoverflow.com/questions/10316247/media-queries-fail-inside-i...). See this commit for a fix if you're having this problem. https://github.com/NewSignature/Respond/commit/1c86c66075f0a2099451eb426...
Apparently it´s a IE9 bug. That fork solves the issue by applying respond also to IE9 when in an iframe.
Internet Explorer 9 supports css3 media queries, but not within frames
(this appears to be a bug in IE9). Modifying this script to check for
IE9 and check if within iframe and run if true.- if( respond.mediaQueriesSupported ){ return; }
+ if( respond.mediaQueriesSupported && !isIE9iframe() ){ return; }
Substituting respond.min.js (libraries) with the file in that commit solves the iframe issue.
I made a patch to change the download URL to point to that branch instead of the master. It also changes the included respond.min.js file in the module´s /lib directory.
| Comment | File | Size | Author |
|---|---|---|---|
| respondjs_ie9_iframe.patch | 10.08 KB | tahiche |
Comments
Comment #2
ruplThanks for the stellar report and patch!
I'm not able to review and commit this for another two weeks as I'm currently traveling. But I will be back to a computer around the beginning of April and will revisit this issue at that time.
Comment #3
ruplOk I looked at this more closely and I don't want to point the module at a fork of the library, which is several versions out of date since it was modified in mid-2012 (1.1.0 vs 1.4.2 at the time of comment).
I scanned the commit list and it doesn't seem to be merged into the original library. However I accept that this is a widespread bug and a decent fix. Maybe we could add some docs to our module page which point people in the right direction?
Comment #4
tahiche commentedHi, I agree in that pointing to a fork is not too "solid" of a solution.
I don´t know why it hasn´t been merged. It´s certainly a lot worse without it!!.
Like you say, adding docs to the module page and maybe a link to the actual patch would be a better alternative.
Comment #5
astonvictor commentedD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.