簡單的滑鼠移出移入樣式改變
阿新 • • 發佈:2019-02-04
<!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>
<style type="text/css">
.style0{
background-color:#999;<!--移入-->
}
.style1{
background-color:#CCF;<!--移出-->
}
</style>
</head>
<body>
<table width="500px" height="100px" 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>
</tr>
</table>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<style type="text/css">
.style0{
background-color:#999;<!--移入-->
}
.style1{
background-color:#CCF;<!--移出-->
}
</style>
</head>
<body>
<table width="500px" height="100px" 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>
</tr>
</table>
</body>
</html>