The MediaQueryListEvent()
constructor creates a new MediaQueryListEvent
instance.
MediaQueryListEvent()
Syntax
new MediaQueryListEvent(typeArg, init);
Parameters
-
typeArg
-
A string representing the name of the event.
-
init
Optional -
An init object that defines features of the new object instance. The available properties are:
Examples
var media = '(max-width: 600px)'; var matches = true; var myMediaQueryListEvent = new MediaQueryListEvent("change", {media, matches});
Specifications
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
MediaQueryListEvent |
39
|
79
|
55
|
No
|
26
|
14
|
39
|
39
|
55
|
26
|
14
|
4.0
|
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent/MediaQueryListEvent