zoukankan      html  css  js  c++  java
  • jquery星级评定效果(原创)

    今天自学jquery,原创实现了一个星级评定的效果,好happy啊!

    下面是代码,欢迎拍砖!

    <!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>
        <title>星级评定效果</title>
        <script type="text/javascript" src="Scripts/jquery-1.6.2.js"></script>
        <style type="text/css">
            ul
            {
                font-size: 26px;
                color: #808080;
                list-style-type: none;
            }
    
            li
            {
                display: inline;
                cursor: pointer;
            }
        </style>
        <script type="text/javascript">
            $(function () {
                var s = false;
                var num = 0;
                $("li").click(function () {
                    s = true;
                    num = $("li").index(this);
                });
                $("li").mouseover(function () {
                    $(this).css("color", "yellow").prevAll().css("color", "yellow");
                    $(this).nextAll().css("color", "#808080");
                }).mouseout(function () {
                    if (s) {
                        qs = num + 1;
                        $("li:lt(" + qs + ")").css("color", "yellow");
                        $("li:gt(" + num + ")").css("color", "#808080");
                    }
                    else {
                        $("li").css("color", "#808080");
                    }
                });
            });
        </script>
    </head>
    <body>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </body>
    </html>
  • 相关阅读:
    [HDU3487]Play with Chain
    [HDU3436]Queue-jumpers
    [HDU2475]Box
    [HDU1890]RoboticSort
    [BZOJ1500]维修数列
    [POJ3580]SuperMemo
    [POJ3481]Double Queue
    [BZOJ1269]文本编辑器editor
    简单的sql注入
    图片马的制作以及菜刀的使用
  • 原文地址:https://www.cnblogs.com/fumj/p/2563719.html
Copyright © 2011-2022 走看看