diff options
Diffstat (limited to 'files/de/web/api/globaleventhandlers/onresize/index.html')
| -rw-r--r-- | files/de/web/api/globaleventhandlers/onresize/index.html | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/files/de/web/api/globaleventhandlers/onresize/index.html b/files/de/web/api/globaleventhandlers/onresize/index.html new file mode 100644 index 0000000000..b9866678c3 --- /dev/null +++ b/files/de/web/api/globaleventhandlers/onresize/index.html @@ -0,0 +1,77 @@ +--- +title: GlobalEventHandlers.onresize +slug: Web/API/GlobalEventHandlers/onresize +tags: + - API + - DOM + - Property +translation_of: Web/API/GlobalEventHandlers/onresize +--- +<p>{{ ApiRef() }}</p> + +<p>Die <strong>GlobalEventHandlers.onresize</strong> Property enthält einen {{domxref("EventHandler")}}, der ausgelöst wird, sobald ein {{event("resize")}}-Event empfangen wird.</p> + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="eval">window.onresize = <em>funcRef</em>; +</pre> + +<h3 id="Parameters" name="Parameters">Parameter</h3> + +<ul> + <li><code>funcRef</code> ist eine Referenz auf eine Funktion.</li> +</ul> + +<h2 id="Example" name="Example">Beispiel</h2> + +<pre>window.onresize = doFunc; +</pre> + +<pre><html> +<head> + +<title>onresize Test</title> + +</head> + +<body> +<p>Verändere die Größe des Browser Fensters, um den resize-Event auszulösen.</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> +</pre> + +<h2 id="Notes" name="Notes">Anmerkung</h2> + +<p>Das resize-Event wird ausgelöst nachdem die Größe des Fensters verändert wurde.</p> + +<h2 id="Specification" name="Specification">Spezifikation</h2> + +<table class="spectable standard-table"> + <tbody> + <tr> + <th scope="col">Spezifikation</th> + <th scope="col">Status</th> + <th scope="col">Kommentar</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG','webappapis.html#handler-onresize','onresize')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + </tbody> +</table> |
