Home > Web Front-end > JS Tutorial > body text

js控制鼠标事件移动及移出效果显示_javascript技巧

WBOY
Release: 2016-05-16 16:33:30
Original
1606 people have browsed it

鼠标事件的移动及移出效果都可以使用js来自定义,下面有个示例,效果为当事件发生改变时背景颜色也随着改变,适合新手朋友

<style type="text/css">
.style0{
background-color:#FFFF00;
}
.style1{
background-color:#00FFFF;
}
</style>
</head>


<body>
<table width="576" height="79" border="1">
<tr>
<td id="td1" onmousemove="document.getElementById('td1').className='style0';" onmouseout="document.getElementById('td1').className='style1'"><div align="center" class="STYLE2">主页</div></td>
<td><div align="center" class="STYLE2">男</div></td>
<td><div align="center" class="STYLE2">女</div></td>
</tr>
</table>
</body> 
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!