From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../api/globaleventhandlers/onresize/index.html | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/fr/conflicting/web/api/globaleventhandlers/onresize/index.html (limited to 'files/fr/conflicting/web/api/globaleventhandlers') diff --git a/files/fr/conflicting/web/api/globaleventhandlers/onresize/index.html b/files/fr/conflicting/web/api/globaleventhandlers/onresize/index.html new file mode 100644 index 0000000000..d2c0d6304f --- /dev/null +++ b/files/fr/conflicting/web/api/globaleventhandlers/onresize/index.html @@ -0,0 +1,78 @@ +--- +title: window.onresize +slug: Web/API/Window/onresize +tags: + - API + - DOM + - Gestionnaires d'évènements + - Propriété + - évènements +translation_of: Web/API/GlobalEventHandlers/onresize +--- +

{{ ApiRef() }}

+ +

La propriété GlobalEventHandlers.onresize contient un {{domxref("EventHandler")}} (gestionnaire d'évènements) qui survient quand un évènement {{event("resize")}} est reçu.

+ +

Syntaxe

+ +
window.onresize = funcRef;
+
+ +

Paramètres

+ + + +

Exemple

+ +
window.onresize = doFunc;
+
+ +
<html>
+<head>
+
+<title>onresize test</title>
+
+</head>
+
+<body>
+<p>Resize the browser window to fire the resize event.</p>
+
+<p>Window height: <span id="height"></span></p>
+<p>Window width: <span id="width"></span></p>
+
+<script type="text/javascript">
+  var heightOutput = document.querySelector('#height');
+  var widthOutput = document.querySelector('#width');
+
+  function resize() {
+    heightOutput.textContent = window.innerHeight;
+    widthOutput.textContent = window.innerWidth;
+  }
+
+  window.onresize = resize;
+</script>
+</body>
+</html>
+ +

Notes

+ +

L’événement resize est déclenché après le redimensionnement de la fenêtre.

+ +

Spécification

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('HTML WHATWG','webappapis.html#handler-onresize','onresize')}}{{Spec2('HTML WHATWG')}} 
-- cgit v1.2.3-54-g00ecf