zoukankan      html  css  js  c++  java
  • JQuery 评分系统

             
    评分:
    <!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 src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function () {
                $("#tbl1 td").text("").css("cursor", "pointer").mouseover(function () { $("#tbl1 td").text("").css("color", "red"); $(this).nextAll("td").text("").css("color", "Black"); });
    
                $("#tbl2").mouseover(function () { $(this).siblings("td").text("").css("color", "Black"); }); //鼠标指向“评分:”时0星
                $(".grade").click(function () { alert($(this).attr("title")) }); //"attr"概述:设置或返回被选元素的属性值。
                $(".grade").css("cursor", "pointer").mouseover(function () { $(".grade").text("").css("color", "red"); $(this).nextAll("td").text("").css("color", "Black"); });
            });
        </script>
    </head>
    <body>
    <table id="tbl1">
        <tr><td></td><td></td><td></td><td></td><td></td></tr>
    </table>
    <p></p>
    <table>
        <tr><td id="tbl2">评分:</td><td class="grade" title="一星">☆</td><td class="grade" title="二星">☆</td><td class="grade" title="三星">☆</td><td class="grade" title="四星">☆</td><td class="grade" title="五星">☆</td></tr>
    </table>
    </body>
    </html>
  • 相关阅读:
    CSU 1333 Funny Car Racing
    FZU 2195 检查站点
    FZU 2193 So Hard
    ZOJ 1655 FZU 1125 Transport Goods
    zoj 2750 Idiomatic Phrases Game
    hdu 1874 畅通工程续
    hdu 2489 Minimal Ratio Tree
    hdu 3398 String
    洛谷 P2158 [SDOI2008]仪仗队 解题报告
    POJ 1958 Strange Towers of Hanoi 解题报告
  • 原文地址:https://www.cnblogs.com/han1982/p/3229172.html
Copyright © 2011-2022 走看看