
- 0133技术站
- 联系QQ:88526
- QQ交流群
- 微信公众号

定义和用法
onmouseout 属性在鼠标指针移除元素时触发。
注意: onmouseout 属性不能使用于以下元素: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, 或 <title>。
浏览器支持

所有主流浏览器都支持 onmouseout 事件属性
HTML 4.01 与 HTML5之间的差异
无。
语法
<element onmouseout="script">
属性值
| 值 | 描述 |
|---|---|
| script | 规定该onmouseout事件触发时执行的脚本。 |
当鼠标指针移出图片时运行脚本:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>0133技术站(0133.cn)</title>
<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 onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="http://ss.0133.cn/upload/image/858/817/174/1553759438134026.gif" alt="Smiley" width="32" height="32">
<p>当用户将鼠标移动到图片时触发 bigImg() 函数。该函数使图片变大。</p>
<p>当用户将鼠标移开时触发normalImg() 函数。该函数使图片变回原来大写。</p>
</body>
</html>点击 "运行实例" 按钮查看在线实例
推荐手册