File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,17 @@ $.mobile.media = (function() {
2828
2929 return function ( query ) {
3030 if ( ! ( query in cache ) ) {
31- var styleBlock = $ ( "<style type='text/css'>" +
32- "@media " + query + "{#jquery-mediatest{position:absolute;}}" +
33- "</style>" ) ;
31+ var styleBlock = document . createElement ( 'style' ) ,
32+ cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }" ;
33+ //must set type for IE!
34+ styleBlock . type = "text/css" ;
35+ if ( styleBlock . styleSheet ) {
36+ styleBlock . styleSheet . cssText = cssrule ;
37+ }
38+ else {
39+ styleBlock . appendChild ( document . createTextNode ( cssrule ) ) ;
40+ }
41+
3442 $html . prepend ( fakeBody ) . prepend ( styleBlock ) ;
3543 cache [ query ] = testDiv . css ( "position" ) === "absolute" ;
3644 fakeBody . add ( styleBlock ) . remove ( ) ;
You can’t perform that action at this time.
0 commit comments