天天看点

鼠标点击后改变样式

<!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">

<!--

.Out {

background-image:url(navgations0.jpg);

width:40px;

height:32px;

cursor:hand;

}

.ove{

background-image:url(navgations1.jpg);

width:40px;

height:32px;

cursor:hand;

}

-->

</style>

</head>

<body>

<script>

function Mou(obj)

{

   document.getElementById("aa").className="Out";

   document.getElementById("xx").className="Out";

   document.getElementById("bb").className="Out";

   obj.className="ove";

}

</script>

<table width="450" background="navgations0.jpg">

  <tr>

    <th scope="col" id="aa" class="ove" οnclick="Mou(this)">hhhh</th>

    <th scope="col" id="xx" class="out" οnclick="Mou(this)">hhhh</th>

    <th scope="col" id="bb" class="out" οnclick="Mou(this)">hhhh</th>

  </tr>

</table>

</body>

</html>

继续阅读