五星好评的效果

     <div class="order-list-Below">
            <h1>商品评价</h1>
            <ul>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
            <div class="order-textbox">
                <textarea placeholder="在此输入商品评价"></textarea>
            </div>
        </div>
.order-list-Below ul {
  float: left;
  padding-left: 15px;
}
.order-list-Below ul li {
  float: left;
  width: 28px;
  height: 17px;
  background: url("../images/pic_heart01.png") no-repeat left top;
  background-size: 17px 17px;
}
.order-list-Below ul li.on {
  background: url("../images/pic_heart02.png") no-repeat left top;
  background-size: 17px 17px;
}
.order-list-Below .order-textbox {
  clear: both;
}
.order-list-Below .order-textbox textarea {
  width: 100%;
  height: 60px;
  padding: 5px;
  border: none;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-family: myFirstFont ;
  font-size: 13px;
  color: #ccc;
}
function(){ 
$(".order-list-Below ul li").click(
        var num = $(this).index()+1;
        var len = $(this).index();
        var thats = $(this).parent(".order-list-Below ul").find("li");
        // var thats = $(this).parent(".order-list-Below ul").find("li");
        if($(thats).eq(len).attr("class")=="on"){
            if($(thats).eq(num).attr("class")=="on"){
                $(thats).removeClass();
                for (var i=0 ; i<num; i++) {
                    $(thats).eq(i).addClass("on");
                }
            }else{
                $(thats).removeClass();
                for (var k=0 ; k<len; k++) {
                    $(thats).eq(k).addClass("on");
                }
            }
        }else{
            $(thats).removeClass();
            for (var j=0 ; j<num; j++) {
                $(thats).eq(j).addClass("on");
            }
        }
   );
 }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值