English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Der resize-Event wird ausgelöst, wenn die Dokumentansicht angepasst wird.
Führen Sie JavaScript aus, wenn der Browserfenstergröße geändert wird:
<!DOCTYPE html> <html> <head> <title>Verwendung der onresize-Event-Eigenschaft von HTML (Grund教程网 oldtoolbag.com)</title> </head> <body onresize="myFunction()"> <p>Try to resize the browser window.</p> <script> function myFunction() { alert("You have changed the size of the browser window!"); } </script> </body> </html>Test See ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the onresize event attribute
The onresize attribute is triggered when the browser window size is adjusted.
The onresize attribute is commonly used to adjust the window size.
None.
<element onresize="script">
Value | Description |
---|---|
script | Specifies the script to be executed when the onresize event is triggered. |