当前位置:软件学堂 > 资讯首页 > 网络编程 > 编程其他 > Javascript鼠标事件

Javascript鼠标事件

2012/11/28 16:42:18作者:佚名来源:网络

移动端

【实例介绍】

Javascript鼠标事件
鼠标移动事件包括三种,分别为mouseover、mouseout和mousemove。其中,mouseover是当鼠标移动到对象之上时所激发的事件,mouseout是当鼠标从对象上移开时所激发的事件,mousemove是鼠标在对象上移动时所激发的事件。

【实例代码】

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <table width="300" height="47" border="1" cellpadding="1" cellspacing="0" bordercolor="#FF0000" onmouseover=this.style.backgroundColor="#FFCCFF"; onmouseout=this.style.backgroundColor="FFCC33";cellspacing="1"> <tr> <td>onMouseOver和onMouseOut事件</td> </tr> </table> </body> </html> 【代码分析】

在浏览器中预览,效果如图所示。

鼠标事件

 【素材及源码下载】

请点击:鼠标事件 下载本实例相关素材及源码

 

标签: 鼠标