mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-16 04:11:01 +00:00
small workaround to get media query function to work on Nokia
This commit is contained in:
parent
02c9264f0d
commit
f85e4c916b
1 changed files with 11 additions and 3 deletions
|
|
@ -28,9 +28,17 @@ $.mobile.media = (function() {
|
|||
|
||||
return function( query ) {
|
||||
if ( !( query in cache ) ) {
|
||||
var styleBlock = $( "<style type='text/css'>" +
|
||||
"@media " + query + "{#jquery-mediatest{position:absolute;}}" +
|
||||
"</style>" );
|
||||
var styleBlock = document.createElement('style'),
|
||||
cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }";
|
||||
//must set type for IE!
|
||||
styleBlock.type = "text/css";
|
||||
if (styleBlock.styleSheet){
|
||||
styleBlock.styleSheet.cssText = cssrule;
|
||||
}
|
||||
else {
|
||||
styleBlock.appendChild(document.createTextNode(cssrule));
|
||||
}
|
||||
|
||||
$html.prepend( fakeBody ).prepend( styleBlock );
|
||||
cache[ query ] = testDiv.css( "position" ) === "absolute";
|
||||
fakeBody.add( styleBlock ).remove();
|
||||
|
|
|
|||
Loading…
Reference in a new issue