06JQuery笔记----------------------五角星评分系统

 1 <html xmlns="http://www.w3.org/1999/xhtml">
 2 <head>
 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 4     <title></title>
 5     <script src="jquery-1.8.3.js"></script>
 6     <script type="text/javascript">
 7         $(function () {
 8             $('#tb td').mouseover(function () {
 9              
10                 $(this).text('★').prevAll('td').text('★');
11             }).mouseout(function () {
12                 $(this).nextAll('td').text('☆');
13             });
14         });
15     </script>
16 </head>
17 <body>
18     <table id="tb" border="1" style="cursor:pointer">
19         <tr>
20             <td>☆</td>
21             <td>☆</td>
22             <td>☆</td>
23             <td>☆</td>
24             <td>☆</td>
25             <td>☆</td>
26             <td>☆</td>
27             <td>☆</td>
28             <td>☆</td>
29             <td>☆</td>
30         </tr>
31     </table>
32 </body>
33 </html>

 

posted on 2016-01-12 10:54  努力的活着_在人间  阅读(199)  评论(0)    收藏  举报

导航