• 迅雷影评效果


    <!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>
    <style>
       div,ul,li{margin:0;padding:0}
       ul,li{list-style:none}
       .comment p{border:1px solid #ccc;width:100px;clear:both;text-align:center;display:none}
       .comment li{float:left;width:22px;height:21px;background:url(sprite.png) no-repeat -24px 0;}
       .comment li.active{background:url(sprite.png) no-repeat}
    </style>
    <script>
    window.onload=function(){
          var odiv = document.getElementById('comment');
          var oli = odiv.getElementsByTagName('li');
          var op = odiv.getElementsByTagName('p')[0];
          var atemp =['很差','比较差','一般','挺好','非常好']
          //alert('test')
          for(var i =0;i< oli.length;i++){
              oli[i].index = i
              oli[i].onmouseover = function(){
                 for(i=0;i<=this.index;i++){
                     oli[i].className = 'active'        
                 }
                 op.style.display ='block';
                 op.innerHTML =atemp[this.index]
               }
              oli[i].onmouseout = function(){
                 for(i=0;i<=this.index;i++){
                     oli[i].className = ''        
                 }
                 op.style.display ='none';
               }
              oli[i].onclick = function(){
                 alert('您已评了'+(this.index+1)+'分')      
              }
          }
      }
    </script>
    </head>

    <body>
    <div id="comment" class="comment">
          <ul>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
              <li></li>
          </ul>
          <p>推荐</p>
    </div>
    </body>
    </html>
     




    附件列表

    • 相关阅读:
      BZOJ3171: [Tjoi2013]循环格
      Luogu P1850 换教室(期望dp)
      Luogu P3825 [NOI2017]游戏(2-SAT)
      Luogu P3007 [USACO11JAN]大陆议会The Continental Cowngress
      Luogu P2272 [ZJOI2007]最大半连通子图(Tarjan+dp)
      Luogu P3209 [HNOI2010]平面图判定(2-SAT)
      Luogu P4171 [JSOI2010]满汉全席(2-SAT)
      Luogu P4782 【模板】2-SAT 问题(2-SAT)
      Luogu P2845 [USACO15DEC]Switching on the Lights 开关灯(bfs)
      Luogu P4933 大师(dp)
    • 原文地址:https://www.cnblogs.com/zjx2011/p/0a39cb3fd785ee7c3fdc9d0f7f617078.html
    Copyright © 2020-2023  润新知