?????? ?? ???
/ onmouseout 事件
onmouseout 事件
onmouseout 事件
實(shí)例
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script> function bigImg(x){ x.style.height="64px"; x.style.width="64px"; } function normalImg(x){ x.style.height="32px"; x.style.width="32px"; } </script> </head> <body> <img onmouseover="bigImg(this)" onmouseout="normalImg(this)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32"> <p>函數(shù) bigImg() 在鼠標(biāo)指針移動(dòng)到笑臉圖片是觸發(fā)。</p> <p>函數(shù) normalImg() 在鼠標(biāo)指針移出笑臉圖片是觸發(fā).</p> </body> </html>
運(yùn)行實(shí)例 ?
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例
定義和用法
onmouseout 事件會(huì)在鼠標(biāo)指針移出指定的對(duì)象時(shí)發(fā)生。
語法
HTML 中:
<elementonmouseout="SomeJavaScriptCode">
JavaScript 中:
object.onmouseout=function(){SomeJavaScriptCode};
參數(shù) | 描述 |
---|---|
SomeJavaScriptCode | 必需。規(guī)定該事件發(fā)生時(shí)執(zhí)行的 JavaScript。 |
瀏覽器支持
所有主要瀏覽器都支持 onmouseout 事件
支持該事件的 HTML 標(biāo)簽:
onmouseout 屬性可使用于使用 HTML 元素,除了: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, 和 <title>.