MediaQueryList

EventTargetjs.html.MediaQueryList (extern class)

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:

Instance Members

media: String

A DOMString representing a serialized media query.


matches: Bool

A Boolean that returns true if the document currently matches the media query list, or false if not.


onchange: haxe.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.


addListener(listener: Function): 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.

Name Type
listener Function

removeListener(listener: Function): Void

Removes a listener from the MediaQueryListener. This is basically an alias for EventTarget.removeEventListener(), for backwards compatibility purposes.

Name Type
listener Function