English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
A propriedade onmouseout é usada para obter ou definir a função de manipulação de eventos do evento onmouseout do elemento atual
Executar JavaScript ao sair o ponteiro do mouse da imagem:
<!DOCTYPE html> <html> <head> <title>Uso do atributo onmouseout no HTML (Tutoriais Básicos da Web oldtoolbag.com)</title> </head> <body> <img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="pig.gif" alt="pig" width="32" height="32"> <p>Quando o ponteiro do mouse está sobre a imagem, aciona a função bigImg(). Esta função amplifica a imagem.<br> Quando o ponteiro do mouse sai da imagem, aciona a função normalImg(). Esta função define a altura e largura da imagem como normal.</p> <script> function bigImg(x) { x.style.height = ""64px"; x.style.width = ""64px"; px"; function normalImg(x) { x.style.height = ""32px"; x.style.width = ""32px"; px"; </} </script> </body>html>/Test and see ‹
Browser compatibilityIEFirefoxOperaChrome
Safari
Definition and usage
The onmouseout attribute is triggered when the mouse pointer moves out of the element.Tip: The onmouseout attribute is usually used withused together with the
Note: The onmouseout attribute cannot be used with 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. |