<!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>jQuery基于图层模仿五星星评价功能_www.jb200.com</title>
<script src="jquery-1.6.2.min.js" type="text/
javascript"></script>
<script>
$(function(){
$(".star li").mouseenter(function(){
$(".star li").css("background","#f60");
$(this).css("background","#f60");
$(this).nextAll().css("background","#ccc");
})
});
</script>
<style type="text/css">
* {<br />
padding:0;margin:0;
list-style:none; float:left;
}
.star li {
float: left;
height: 20px;
width: 20px;
background-color: #CCC;
margin-right: 4px;
}
</style>
</head>
<body>
<div>选几星:</div>
<ul class="star">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
</html>