jQuery实现的背景修改简单---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" src="igrs/js/jquery-1.3.2.js"></script>
<script>
$(document).ready(function(){
$(".imgs").mouseover(function(){
$(this).addClass("imgs_bg").siblings().removeClass("imgs_bg");
});
$(".imgs").mouseout(function(){
$(this).removeClass("imgs_bg");
});
});
</script>
<style>
.imgs{ width:100px; height:30px;}
.imgs_bg{ background-color:#99FF66; border:1px #CCCCCC solid;}
</style>
</head>
<body style="margin:0px; height:100%">
<div class="imgs">1111111</div>
<div class="imgs">2222222</div>
<div class="imgs">3333333</div>
<div class="imgs">4444444</div>
</body>
</html>
|