Skip to content

Commit

Permalink
styled fakeBody to have background: none, preventing IE crashes when …
Browse files Browse the repository at this point in the history
…background image is on body element. Addresses issue #106. Please confirm the fix!
  • Loading branch information
scottjehl committed Mar 9, 2012
1 parent fd892e1 commit ed8479c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions respond.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions respond.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){

div.id = 'mq-test-1';
div.style.cssText = "position:absolute;top:-100em";
fakeBody.style.background = "none";
fakeBody.appendChild(div);

return function(q){
Expand Down Expand Up @@ -176,6 +177,7 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){

if( !body ){
body = fakeUsed = doc.createElement( "body" );
body.style.background = "none";
}

body.appendChild( div );
Expand Down

1 comment on commit ed8479c

@davidnknight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this fixes the crash issues we experienced with IE8 on Windows XP. Thanks!

Please sign in to comment.