MediaQueryList
A MediaQueryList object stores information on a media query applied to a document, and handles sending notifications to listeners when the media query state change (i.e. when the media query test starts or stops evaluating to true).
Documentation MediaQueryList by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
media: StringA DOMString representing a serialized media query.
matches: BoolA Boolean that returns true if the document currently matches the media query list, or false if not.
onchange: haxe.FunctionAn event handler property representing a function that is invoked when the change event fires, i.e when the status of media query support changes. The event object is a MediaQueryListEvent instance, which is recognised as a MediaListQuery instance in older browsers, for backwards compatibility purposes.
addListener(listener: Function): VoidAdds a listener to the MediaQueryListener that will run a custom callback function in response to the media query status changing. This is basically an alias for EventTarget.addEventListener(), for backwards compatibility purposes.
| Name | Type |
|---|---|
listener |
Function |
removeListener(listener: Function): VoidRemoves a listener from the MediaQueryListener. This is basically an alias for EventTarget.removeEventListener(), for backwards compatibility purposes.
| Name | Type |
|---|---|
listener |
Function |