星星打分




//获取评分
////////////////////评分/////////////////////////////
$(function (){
$("#star").bind("click",ratingS('star','star_word','res',true));
        $("#star1").bind("click",ratingS('star1','star_word1','res1',false));

})
  function ratingS(name,s,res,bo){
var star = document.getElementById(name);
var star_li = star.getElementsByTagName("li");
var star_word = document.getElementById(s);
var i=0;
var j=0;
var act;
var res;
if(bo){
act="act";
res="myd";
}else{
res="xysd";
act="act1";
}
var len = star_li.length;
var word = ['很差','差','一般','好','很好'];
var word1=['很慢','慢','一般','快','非常快'];
 
for(i=0; istar_li[i].index = i;
star_li[i].onmouseover = function(){
  star_word.style.display = "block";
  if(bo){
  star_word.innerHTML = word[this.index];
}else{
 star_word.innerHTML = word1[this.index];
}
  for(i=0; i<=this.index; i++){
 star_li[i].className = act;

}
star_li[i].οnmοuseοut=function(){
for(i=0; i<=this.index; i++){
 star_li[i].className = '';
 

var j=$("li[id="+act+"]").length;
if($("li[id="+act+"]").length!=0){
 for(k=0;kstar_li[k].className=act;


 
if($("."+act).length!=0){
 if(bo){
  star_word.innerHTML = word[$("."+act).length-1];
}else{
 star_word.innerHTML = word1[$("."+act).length-1];
}
}else{
if(bo){
  star_word.innerHTML = '';
}else{
 star_word.innerHTML = '';
}
}
}
star_li[i].onclick = function(){
$("input[name="+res+"]").val(this.index+1);
 
for(j=0;jstar_li[j].setAttribute("id",act);
}
if(!(star_li[i]==undefined)){
if(star_li[i].getAttribute("id")==act){
for(i; i star_li[i].setAttribute("id","");
 star_li[i].className='';
}
}
if(!(star_li[i]==undefined)){
if(star_li[i].className==act){
for(i; i<=len; i++){
star_li[i].className='';
}
}
}
}

}
}
}




满意度:














响应速度:













你可能感兴趣的:(java,框架)