当前位置: 代码迷 >> HTML/CSS >> 鼠标搬动改变CSS样式
  详细解决方案

鼠标搬动改变CSS样式

热度:96   发布时间:2012-09-07 10:38:15.0
鼠标移动改变CSS样式
<style type="text/css">
.changeColor {
	font-size: 14px;
	color:#FFF;
	background-color: #09C;
	text-decoration: underline;
}
.original {
	font-size: 14px;
	color: #09C;
	text-decoration: underline;
}
</style>
<script language="javascript">
		function changeBlue(){
			document.getElementById('change').className="original";
		}
		function changeRed(){
			document.getElementById('change').className="changeColor";
		}
</script>
</head>
<body>
<span class="original" id="change" onmouseover="changeRed()" onmouseout="changeBlue()">变色龙
</span>
</body>
  相关解决方案