<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
body,div,ul,li,p{margin:0;padding:0;}
body{color:#666;font:12px/1.5 Arial;}
ul{list-style-type:none;}
#star{position:relative;width:500px;margin:35px auto;}
#star ul,#star span{float:left;display:inline;height:35px;line-height:29px;}
#star ul{margin:0 10px;}
#star li{float:left;width:35px;cursor:pointer;text-indent:-9999px;background:url(../0519/star.gif) no-repeat;}
#star p{position:absolute;top:20px;width:159px;height:60px;display:none;background:url(../0519/star.gif) no-repeat;padding:70px 10px 0; }
#star p em{color:#f60;display:block;font-style:normal;}
</style>
<script type="text/javascript">
function mouseOver(a)
{
var oUl=document.getElementsByTagName("ul")[0];
var aLi=document.getElementsByTagName("li")[0];
for(var i=0;i<a;i++){
oUl.children[i].style.backgroundPosition=‘0 -29px‘;
}
}
function mouseOut()
{
var arr = new Array();
for(var i=0;i<5;i++){
arr[i]=document.getElementById(‘star‘).children[1].children[i];
arr[i].style.backgroundPosition=‘0 0‘;
}
}
function Click(p)
{alert(p+"分")
}
</script>
</head>
<body>
<div id="star" ">
<span>点击星星就能打分</span>
<ul>
<li onmouseover="mouseOver(1)" onmouseout="mouseOut()" onClick="Click(1)">1</li>
<li onmouseover="mouseOver(2)" onmouseout="mouseOut()" onClick="Click(2)">2</li>
<li onmouseover="mouseOver(3)" onmouseout="mouseOut()" onClick="Click(3)">3</li>
<li onmouseover="mouseOver(4)" onmouseout="mouseOut()" onClick="Click(4)">4</li>
<li onmouseover="mouseOver(5)" onmouseout="mouseOut()" onClick="Click(5)">5</li>
</ul>
</div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
body,div,ul,li,p{margin:0;padding:0;}
body{color:#666;font:12px/1.5 Arial;}
ul{list-style-type:none;}
#star{position:relative;width:500px;margin:35px auto;}
#star ul,#star span{float:left;display:inline;height:35px;line-height:29px;}
#star ul{margin:0 10px;}
#star li{float:left;width:35px;cursor:pointer;text-indent:-9999px;background:url(../0519/star.gif) no-repeat;}
#star p{position:absolute;top:20px;width:159px;height:60px;display:none;background:url(../0519/star.gif) no-repeat;padding:70px 10px 0; }
#star p em{color:#f60;display:block;font-style:normal;}
</style>
<script type="text/javascript">
function mouseOver(a)
{
var oUl=document.getElementsByTagName("ul")[0];
var aLi=document.getElementsByTagName("li")[0];
for(var i=0;i<a;i++){
oUl.children[i].style.backgroundPosition=‘0 -29px‘;
}
}
function mouseOut()
{
var oUl=document.getElementsByTagName("ul")[0];
var aLi=document.getElementsByTagName("li")[0];
for(var i=0;i<5;i++){
oUl.children[i].style.backgroundPosition=‘0 0‘;
}
}
function Click(p)
{alert(p+"分")
}
</script>
</head>
<body>
<div id="star" ">
<span>点击星星就能打分</span>
<ul>
<li onmouseover="mouseOver(1)" onmouseout="mouseOut()" onClick="Click(1)">1</li>
<li onmouseover="mouseOver(2)" onmouseout="mouseOut()" onClick="Click(2)">2</li>
<li onmouseover="mouseOver(3)" onmouseout="mouseOut()" onClick="Click(3)">3</li>
<li onmouseover="mouseOver(4)" onmouseout="mouseOut()" onClick="Click(4)">4</li>
<li onmouseover="mouseOver(5)" onmouseout="mouseOut()" onClick="Click(5)">5</li>
</ul>
</div>
</body>
</html>