<!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>网页特效-综合特效-优化的打分星星评价效果</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<script type="text/javascript">
function rate(obj,oEvent){
var imgSrc = '/Article/UploadFiles/201004/20100413173623532.gif';
var imgSrc_2 = '/Article/UploadFiles/201004/20100413173637882.gif';
if(obj.rateFlag) return;
var e = oEvent || window.event;
var target = e.target || e.srcElement;
var imgArray = obj.getElementsByTagName("img");
for(var i=0;i<imgArray.length;i++){
imgArray[i]._num = i;
imgArray[i].οnclick=function(){
if(obj.rateFlag) return;
alert(this._num+1);
var inputid=this.parentNode.previousSibling
inputid.value=this._num+1;
}
}
if(target.tagName=="IMG"){
for(var j=0;j<imgArray.length;j++){

if(j<=target._num){
imgArray[j].src=imgSrc_2;
} else {
imgArray[j].src=imgSrc;
}
target.parentNode.οnmοuseοut=function(){
var imgnum=parseInt(target.parentNode.previousSibling.value);
for(n=0;n<imgArray.length;n++){
imgArray[n].src=imgSrc;
}
for(n=0;n<imgnum;n++){
imgArray[n].src=imgSrc_2;
}
}
}
} else {
return false;
}
}
</script>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<input type="hidden" value="0"><p οnmοuseοver="rate(this,event)">
<img src="/Article/UploadFiles/201004/20100413173623532.gif" title="很烂"><img src="/Article/UploadFiles/201004/20100413173623532.gif" title="一般"><img src="/Article/UploadFiles/201004/20100413173623532.gif" title="还好"><img src="/Article/UploadFiles/201004/20100413173623532.gif" title="较好"><img src="/Article/UploadFiles/201004/20100413173623532.gif" title="很好">
</p>
</body>
</html>