62,074
社区成员
发帖
与我相关
我的任务
分享
<!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>
<title>test</title>
<meta name="author" content="sohighthesky"/>
<style type="text/css">
/* pre style*/
body,th,td {font-size:12px;font-family:Verdana,Tahoma,Arial,'\5b8b\4f53','\5FAE\8F6F\96C5\9ED1',sans-serif;}
body,th,td,ol,ul,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,fieldset,legend,input,button,textarea,p {margin:0;padding:0;}
li { list-style-type:none;}
a {color:#3366CC; text-decoration:none;}
a:hover {color:#FF6600;text-decoration:underline;}
/************************************************************/
#div1{margin:20px auto;width:200px;}
.grade_stars{
background:transparent url(http://pages.anjukestatic.com/img/comm/commstar.gif) repeat-x scroll left -26px;
cursor:pointer;
padding:0;
position:relative;
line-height:24px;
width:75px;
}
.grade_stars div{
background:transparent url(http://pages.anjukestatic.com/img/comm/commstar.gif) repeat-x scroll left 4px;
text-indent:-9999px;
width:35px;
}
</style>
</head>
<body>
<div id="div1">
<div class="grade_stars" id="grade_stars">
<div> </div>
</div>
</div>
</body>
<script type="text/javascript">
!function(){
var g=function(id){return typeof(id)==="string"?document.getElementById(id):id};
g("grade_stars").onclick=function(e){
e=window.event || e;
this.children[0].style.width=(e.offsetX ||e.layerX)+"px";
}
}();
</script>
</html>