mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-23 15:44:43 +00:00
added docs for media query function
This commit is contained in:
parent
14b4c9a167
commit
cf2fc6434e
1 changed files with 17 additions and 0 deletions
|
|
@ -71,6 +71,23 @@ $.mobile.addResolutionBreakpoints(1200);
|
|||
$.mobile.addResolutionBreakpoints([1200, 1440]);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<h3>Running Media Queries</h3>
|
||||
<p>jQuery Mobile provides a function that allows you to test whether a particular CSS Media Query applies. Simple call <code>$.mobile.media()</code> and pass a media type or query. If the browser supports that type or query, and it currently applies, the function will return true. If not, it'll return false.</p>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
//test for screen media type
|
||||
$.mobile.media("screen");
|
||||
|
||||
//test a min-width media query
|
||||
$.mobile.media("screen and (min-width: 480px)");
|
||||
|
||||
//test for iOS retina display
|
||||
$.mobile.media("screen and (-webkit-min-device-pixel-ratio: 2)");
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
||||
</div><!-- /content -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue