A MediaQueryList
object maintains a list of media queries on a document
, and handles sending notifications to listeners when the media queries on the document change.
This makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, if you need to detect changes to the values of media queries on a document.
A MediaQueryListListener
is a callback function that gets invoked with a single argument, the MediaQueryList
for which the evaluated result changed.
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'MediaQueryListListener' in that specification. | Working Draft | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | ? | Yes | 6 | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | ? | ? | Yes | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListListener