• jQuery实现星级评测


    效果图片
    html文件

    代码
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="images/jquery-latest.js"></script>
    <script type="text/javascript">
    $(function(){
    $("ul li").each(function(i){                                    
        $(this).click(function(){
        $("li").removeClass("back");                                                  
        $("li:gt("+i+")").addClass("back");     
                     })
                    })
    });

    </script>
    <style  type="text/css">
    .front {
        background:url(images/star_03.jpg);
    }
    .back {
        background:url(images/star_hover.jpg);
    }
    ul {
        list-style:none;
        width:300px;
    }
    ul li {
        display:block;
        float:left;
        border:1px solid #ccc;
        width:31px;
        height:30px;
        background:url(images/star_03.jpg);
        margin:0px 5px 0px;
    }
    </style>
    </head>
    <body>
    <ul>
      
    <li></li>
      
    <li></li>
      
    <li></li>
      
    <li></li>
      
    <li></li>
    </ul>
    </body>
    </html>

    文件下载

    星级评测.rar 

  • 相关阅读:
    [Graph]Doubling Algorithm
    Luogu 3203 BZOJ 2002——弹飞绵羊
    BZOJ 1468——tree
    BZOJ 10628 Luogu 2633
    Mo's Algorithm
    bzoj1063: [Noi2008]道路设计
    bzoj1264: [AHOI2006]基因匹配Match
    bzoj1177: [Apio2009]Oil
    bzoj1260: [CQOI2007]涂色paint
    bzoj3674: 可持久化并查集加强版
  • 原文地址:https://www.cnblogs.com/clc2008/p/1710766.html
Copyright © 2020-2023  润新知