这个应该是前段的事情吧;
这页面就是扒的京东的.但我不知道他这个 星星效果是怎么做的.

解决方案 »

  1.   


    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title> 页面名称 </title>
    <style type="text/css">
    .box {
    color: #999;
    }
    .box .sel {
    color: #f00;
    }</style>
    </head>
    <body>
    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
    <span class="box">
    <span>★</span>
    <span>★</span>
    <span>★</span>
    <span>★</span>
    <span>★</span>
    </span><span>0</span>分
    <script type="text/javascript">
    $(function(){
    $(".box span").click(function(event){
    $(this).parent().find("span").addClass("sel");
    $(this).nextAll().removeClass("sel");
    $(this).parent().next().text($(this).index()+1);
    });
    });</script>
    </body>
    </html>