English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die onmouseout-Attribute wird verwendet, um den aktuellen Event-Handler für das onmouseout-Ereignis des Elements zu erhalten oder zu setzen
Führe JavaScript aus, wenn der Mauszeiger über das Bild hinausgeht:
<!DOCTYPE html> <html> <head> <title>Verwendung der HTML onmouseout-Event-Attribute (Grundlagen-Tutorial-Netz)3codebox.com)</title> </head> <body> <img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="pig.gif" alt="pig" width="32" height="32"> <p>Wenn der Benutzer den Mauszeiger auf das Bild bewegt, wird die Funktion bigImg() ausgelöst. Diese Funktion vergrößert das Bild.<br> Wenn der Mauszeiger über das Bild hinausgeht, wird die Funktion normalImg() ausgelöst. Diese Funktion setzt die Höhe und Breite des Bildes auf normal./p> <script> function bigImg(x) { x.style.height = ""64px"; x.style.width = ""64px"; } function normalImg(x) { x.style.height = ""32px"; x.style.width = ""32px"; } </script> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the onmouseout event attribute
The onmouseout attribute is triggered when the mouse pointer moves out of the element.
Hint: The onmouseout attribute is usually used withonmouseoverAttributes
Note: The onmouseout attribute cannot be used on the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, or <title>.
None.
<element onmouseout="script">
Value | Description |
---|---|
script | Specifies the script to be executed when the onmouseout event is triggered. |