English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
A propriedade onmouseover é usada para obter ou definir a função de manipulação de eventos do evento mouseover do elemento atual
O script é executado quando o ponteiro do mouse está sobre a imagem:
<!DOCTYPE html> <html> <head> <title>Uso da propriedade onmouseover em HTML (Tutorial Básico da Web oldtoolbag.com)</title> </head> <body> <img onmouseover="bigImg(this)" onmouseout="normalImg(this)" border="0" src="pig.gif" alt="pig" width="32" height="32"> <p>Quando o usuário passar o mouse sobre a imagem, será acionada a função bigImg(). Esta função ampliará a imagem. Quando o ponteiro do mouse sai da imagem, será acionada 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"; } function normalImg(x) { x.style.height = ""32px"; x.style.width = ""32px"; } </script> </body> </html>Test see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the onmouseover event attribute
The onmouseover attribute is triggered when the mouse pointer is moved over an element.
Tip: The onmouseover attribute is usually used withonmouseoutattributes together.
Note: The onmouseover attribute cannot be used with the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, or <title>.
None.
<element onmouseover="script">
Value | Description |
---|---|
script | Specifies the script to be executed when the onmouseover event is triggered. |