zoukankan      html  css  js  c++  java
  • js评价五星

    js评价五星

    1、图片(star.png):

    2、图片和html文件在同级目录

    <html>
    <head>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
      $('.difficulty i').click(function(){$(this).nextAll().removeClass('s');$(this).prevAll().addClass('s');$(this).addClass('s');});
      $('.difficulty i').mouseenter(function(){$(this).nextAll().removeClass('h');$(this).prevUntil('.s').addClass('h');$(this).addClass('h');}).mouseleave(function(){$(this).siblings().removeClass('h');$(this).removeClass('h');});
    });
    </script>
    <style  type="text/css">
    .difficulty { 80px; height:14px; float:left; margin:7px 30px 0 0;}
    .difficulty i{ 15px; height:14px; float:left; background:url(star.png) no-repeat -30px 0; margin:0 1px 0 0; cursor:pointer;}
    .difficulty i.h{ background:url(star.png) no-repeat -15px 0;}
    .difficulty i.s{ background:url(star.png) no-repeat 0 0;}
    </style>
    </head>
    
    <body>
    <div class="difficulty"><i></i> <i></i> <i></i> <i></i> <i></i></div>
    </body>
    
    </html>
    

      

  • 相关阅读:
    Xcode及模拟器SDK下载
    修改Navigation Bar上的返回按钮文本颜色,箭头颜色以及导航栏按钮的颜色
    NJKWebViewProgress ——webview进度条
    _tmain 和 main
    XSS原理
    逆向工程
    guide
    网络数据包
    Linux 文件系统 和文件属性
    Linux 文件系统
  • 原文地址:https://www.cnblogs.com/chenweichu/p/7571630.html
Copyright © 2011-2022 走看看