VisualViewport: resize event

The resize event of the VisualViewport interface is fired when the visual viewport is resized.

Bubbles No
Cancelable No
Interface Event
Event handler property onresize

Examples

You can use the resize event in an addEventListener method:

visualViewport.addEventListener('resize', function() {
  ...
});

Or use the onresize event handler property:

visualViewport.onresize = function() {
  ...
};

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
resize_event
62
61
79
91
66
No
49
48
13
62
61
62
61
68
66
46
45
13
8.0
8.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/VisualViewport/resize_event