zoukankan      html  css  js  c++  java
  • 评分案例

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>五角星评分案例</title>
    <style>
    * {
    padding: 0;
    margin: 0;
    }

    .comment {
    font-size: 40px;
    color: yellow;
    }

    .comment li {
    float: left;
    }

    ul {
    list-style: none;
    }
    </style>
    <script src="jquery-1.12.2.js"></script>

    <script>
    // $(function () {
    // //获取所有的li绑定鼠标进入和鼠标离开和点击事件
    // $(".comment>li").mouseover(function () {
    // $(this).text("★").prevAll("li").text("★").end().nextAll("li").text("☆");
    // }).mouseout(function () {
    // $(this).text("☆").prevAll("li").text("☆");
    // //获取属性index为10的这个li和这个li前面所有的li
    // $(".comment>li[index=10]").text("★").prevAll("li").text("★");
    //
    // }).click(function () {
    // $(this).attr("index","10").siblings("li").removeAttr("index");
    // });
    // });
    </script>
    <script>

    $(function () {
    $(".comment>li").mouseover(function () {
    $(this).text("★").prevAll("li").text("★").end().nextAll("li").text("☆");
    }).mouseout(function () {
    $(".comment").find("li").text("☆");
    $(".comment>li[index=1]").text("★").prevAll("li").text("★")
    }).click(function () {
    $(this).attr("index","1").siblings("li").removeAttr("index");
    });
    });
    </script>
    </head>

    <body>
    <ul class="comment">
    <li>☆</li>
    <li>☆</li>
    <li>☆</li>
    <li>☆</li>
    <li>☆</li>
    </ul>
    </body>

    </html>

  • 相关阅读:
    Perl的Open函数
    较详细的介绍JNI
    Java多线程单元测试
    sleep函数的简单原理
    Struts与Servlet的冲突
    Ant学习记录
    JDK转码工具
    Throwable
    Entity Framework系列文章导航
    多核时代 .NET Framework 4 中的并行编程1概述
  • 原文地址:https://www.cnblogs.com/pxxdbk/p/12669059.html
Copyright © 2011-2022 走看看