Media queries for max-width-xxx are all true?
What is the rationale behind the idea of this?
Tested on iPod touch:
- <!doctype html>
- <head>
- <meta charset="utf-8">
- <title></title>
- <meta name="HandheldFriendly" content="True">
- <meta name="MobileOptimized" content="320"/>
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, maximum-scale=1.0">
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
- <script src="js/libs/modernizr-1.7.min.js"></script>
- </head>
- <body>
- <div data-role="page">
- <div data-role="content"></div>
- </div>
- <!-- jQuery mobile -->
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
- <script>
- $(function(){
- $('.ui-page').bind('orientationchange', printDebugQueries);
- printDebugQueries();
- });
- function printDebugQueries() {
- console.log("Landscape: " + $('html').hasClass('landscape') + " | Portrait: " + $('html').hasClass('portrait'));
- console.log("min-width: XXX | max-width: XXX");
- var arr = [320, 480, 960, 768, 1024];
- for(var i = 0; i < arr.length; i++)
- console.log(arr[i] + "px :" + $.mobile.media("screen and (min-width: "+arr[i]+"px)") + " | " + $.mobile.media("screen and (max-width: "+arr[i]+"px)"));
- }
- </script>
- </body>
- </html>
While min-width returns expected result, max-width do not. All of max-width return true.