GlobalEventHandlers.onresize
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since julio de 2015.
La propiedad GlobalEventHandlers.onresize contiene un event handler desencadenado cuando un evento resize es recibido.
Sintaxis
js
window.onresize = funcRef;
Parametros
funcRefes una referencia a una función.
Ejemplo
js
window.onresize = doFunc;
html
<html>
<head>
<title>onresize test</title>
<script type="text/javascript">
window.onresize = resize;
function resize() {
alert("resize event detected!");
}
</script>
</head>
<body>
<p>Resize the browser window to fire the resize event.</p>
</body>
</html>
Notas
El evento resize es activado después de que la ventana ha sido redimensionada.
Especificaciones
| Specification |
|---|
| CSSOM View Module> # eventdef-window-resize> |