好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

html中在鼠标指针移动到元素上时触发的事件属性onmouseover

所有主流浏览器都支持 onmouseover 属性。

定义和用法

onmouseover 属性在鼠标指针移动到元素上时触发。

注释:onmouseover 属性不适用以下元素:<base>、<bdo>、<br>、<head>、<html>、<iframe>、<meta>、<param>、<script>、<style> 或 <title>。

HTML 4.01 与 HTML5 之间的差异

无。

语法

<element onmouseover="script"> 

属性值

值 描述 script onmouseover 发生时运行的脚本。

实例

当鼠标指针移动到图像上时执行一段 JavaScript(使图像放大):

<!DOCTYPE html>  
<html>  
<head>  
<script>  
function bigImg(x)  
{  
x.style.height="180px";  
x.style.width="180px";  
}  
function normalImg(x)  
{  
x.style.height="128px";  
x.style.width="128px";  
}  
</script>  
</head>  
<body>  
<img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="/i/eg_smile.gif" alt="Smiley" >  
<p>函数 bigImg() 在鼠标指针移动到图像上时触发。此函数放大图像。</p>  
<p>函数 normalImg() 在鼠标指针移出图像时触发。此函数把图像的高度和宽度重置为正常尺寸。</p>  
  
</body>  
</html> 

以上就是html中在鼠标指针移动到元素上时触发的事件属性onmouseover的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于html中在鼠标指针移动到元素上时触发的事件属性onmouseover的详细内容...

  阅读:53次