当前位置: 代码迷 >> Web前端 >> 旋钮变色
  详细解决方案

旋钮变色

热度:129   发布时间:2012-08-22 09:50:35.0
按钮变色

<style>
.btFeed{
	background-image: url("../images/default_btn.jpg");
	width: 58px;
	height: 23px;
	border-style:none;
}
.btFeedhover{
	background-image: url("../images/changed_btn.jpg");
	width: 58px;
	height: 23px;
	border-style:none;
}
</style>
<div class="Mp_btns">
      <input type="button" value="确 定 " id="change"/>      
      <input type="button" value="取 消" id="cancel"/>
</div>

<script>
   $(document).ready(function(){
		//按钮背景切换
		$("#change").hover(
			function(){
				$(this).removeClass("btFeed").addClass("btFeedhover");
			},
			function(){
				$(this).removeClass("btFeedhover").addClass("btFeed");
			}
		);
		$("#cancel").hover(
			function(){
				$(this).removeClass("btFeed").addClass("btFeedhover");
			},
			function(){
				$(this).removeClass("btFeedhover").addClass("btFeed");
			}
		);
   });
</script>
?
  相关解决方案