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.
See also:
Variables
onchange:Function
An 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.
Methods
addListener(listener:Event ‑> Void):Void
addListener(listener:Function):Void
addListener(listener:EventListener):Void
Adds 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.
Throws:
null | DOMError |
---|
removeListener(listener:Event ‑> Void):Void
removeListener(listener:Function):Void
removeListener(listener:EventListener):Void
Removes a listener from the MediaQueryListener
. This is basically an alias for EventTarget.removeEventListener()
, for backwards compatibility purposes.
Throws:
null | DOMError |
---|