Adding test for IE9 in iframes #126

Merged
merged 1 commit into from Nov 20, 2013

Conversation

Projects
None yet
7 participants
Contributor

drywall commented May 16, 2012

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 http://stackoverflow.com/questions/10316247/media-queries-fail-inside-ie9-iframe). I've modified the script to add a test for IE9 and check if the page is within an iframe, and run the script if those conditions are met. Otherwise the script bails because respond.mediaQueriesSupported returns true for IE9.

Adding test for IE9 in iframes
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.

Works fine for me.
Thanks.

leslc replied Aug 6, 2013

Thanks, this saved me hours of random debugging!

Glad this has been of use to someone other than me.

rbev replied Jun 26, 2015

This worked for me temporarily when just changing my .js and refreshing.
As soon as i reset the browser the problem comes back

Thanks!!. This was driving me nuts. Dreadful IE9.
Was openening a lightbox iframe and it would destroy the whole layout, not only iframe but top window. Funnily, it wouldn´t happen with Developer Tools open which meant it was impossible to debug. My guess is IE9 applied the media-query CSS according to the size of the "active" window, so as you moved the mouse it would switch from top (big) to iframe (small) and just go crazy.

Hoferer commented Jul 2, 2013

Same here, have tested it on my latest application and it works great.

@jefflembeck jefflembeck merged commit 1c86c66 into scottjehl:master Nov 20, 2013

Works fine for me.
Thanks.

leslc replied Aug 6, 2013

Thanks, this saved me hours of random debugging!

Glad this has been of use to someone other than me.

rbev replied Jun 26, 2015

This worked for me temporarily when just changing my .js and refreshing.
As soon as i reset the browser the problem comes back

Thanks!!. This was driving me nuts. Dreadful IE9.
Was openening a lightbox iframe and it would destroy the whole layout, not only iframe but top window. Funnily, it wouldn´t happen with Developer Tools open which meant it was impossible to debug. My guess is IE9 applied the media-query CSS according to the size of the "active" window, so as you moved the mouse it would switch from top (big) to iframe (small) and just go crazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment