public interface MediaQueryList
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 programmatically detect changes to the values of media queries on a document.
Modifier and Type | Method and Description |
---|---|
void |
addListener(MediaQueryListListener listener)
Adds a new listener to the media query list.
|
String |
getMedia()
The serialized media query list.
|
boolean |
isMatches()
|
void |
removeListener(MediaQueryListListener listener)
|
boolean isMatches()
String getMedia()
void addListener(MediaQueryListListener listener)
Adds a new listener to the media query list. If the specified listener is already in the list, this method has no effect.
listener
MediaQueryListListener
to invoke when the media query's evaluated result changes.void removeListener(MediaQueryListListener listener)
Removes a listener from the media query list. Does nothing if the specified listener isn't already in the list.
listener
MediaQueryListListener
to stop calling on changes to the media query's evaluated result.Copyright © 2018. All rights reserved.