La propiedad matches
de sólo lectura de la interfaz MediaQueryList
es Boolean
que devuelve true
si el document
coincide actualmente con el medio lista de consultas, o false
si no.
Sintaxis
var matches = MediaQueryList.matches;
Value
Examples
var mql = window.matchMedia('(max-width: 600px)');
if(mql.matches) {
// media query test returning true
}
Specifications
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module La definición de 'matches' en esta especificación. |
Working Draft | Initial definition |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 9 | (Yes) | 6.0 (6.0) | 10 | 12.1 | 5 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | ? | (Yes) | ? | ? | ? | ? | ? |