欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jquery五角星评分插件示例分享

程序员文章站 2022-05-28 15:02:15
jquery五角星评分插件代码如下:

jquery五角星评分插件代码如下:


<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>jquery五角星评分插件</title>
<script type="text/javascript" src="js/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/star_rating.js"></script>
<style type="text/css">
#rating_cont { background: #1e1d1c url(images/rating_background.jpg) top left no-repeat; border: 1px solid #f9ba0d; width: 140px; height: 23px; text-align: left; margin-left: 6px;}
 #rating_on { background: url(images/rating_onbackground.jpg) top left no-repeat; width: 0px; height: 21px; position: relative; z-index: 50; top: -21px; }
#rated { display: none; width: 138px; padding: 3px 0px 3px 2px; height: 23px; background-color: #1e1d1c; height: 17px;font-size: 11px;color: #ffc910;}
 #rated p { display: block; float: left; }
 #rating { font-size: 11px; font-family: arial, helvetica, sans-serif; color: #ffc910; padding-left: 3px; width: 22px; }
 #small_stars { height: 11px; width: 69px; background-image: url(images/stars_small_sprite.jpg); background-position: 0px -11px; font-size:1px; line-height: 11px; margin-top:3px; }
 #rate_edit { line-height: 17px; font-size: 11px; font-family: arial, helvetica, sans-serif; color: #fff; padding-left: 9px; cursor: pointer; }
 #rate_edit:hover { text-decoration: underline; }

 

 #rating_btns { position: relative; z-index: 100; width: 140px; height: 21px;}
 #rating_btns ul, #rating_btns li  { padding: 0; margin: 0; }
 #rating_btns li { float: left; width: 14px; height: 21px; display: block; font-size: 1px; cursor: pointer; color: #1e1d1c;
  }
</style>
</head>
<body>
<p id="demo">
 <p id="rating_cont">  
  <p id="rating_btns">
   <ul>
    <li>0.5</li>
    <li>1.0</li>
    <li>1.5</li>
    <li>2.0</li>
    <li>2.5</li>
    <li>3.0</li>
    <li>3.5</li>
    <li>4.0</li>
    <li>4.5</li>
    <li>5.0</li>
   </ul>
  </p> 
  <p id="rating_on" > </p>
  <p id="rated">
   <p id="rating" style="height: 17px; line-height: 17px;">not rated</p>
   <p> -  </p>
   <p id="small_stars"> </p>
   <p id="rate_edit">edit</p>
  </p>  
 </p>
 <input type="hidden" id="rating_output" name="rating_output" value="not rated" />
</p>
</body>
</html>

 

 

. 代码如下:


<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>jquery五角星评分插件 </title>
<script type="text/javascript" src="js/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/star_rating.js"></script>
<style type="text/css">
#rating_cont { background: #1e1d1c url(images/rating_background.jpg) top left no-repeat; border: 1px solid #f9ba0d; width: 140px; height: 23px; text-align: left; margin-left: 6px;}
 #rating_on { background: url(images/rating_onbackground.jpg) top left no-repeat; width: 0px; height: 21px; position: relative; z-index: 50; top: -21px; }
#rated { display: none; width: 138px; padding: 3px 0px 3px 2px; height: 23px; background-color: #1e1d1c; height: 17px;font-size: 11px;color: #ffc910;}
 #rated p { display: block; float: left; }
 #rating { font-size: 11px; font-family: arial, helvetica, sans-serif; color: #ffc910; padding-left: 3px; width: 22px; }
 #small_stars { height: 11px; width: 69px; background-image: url(images/stars_small_sprite.jpg); background-position: 0px -11px; font-size:1px; line-height: 11px; margin-top:3px; }
 #rate_edit { line-height: 17px; font-size: 11px; font-family: arial, helvetica, sans-serif; color: #fff; padding-left: 9px; cursor: pointer; }
 #rate_edit:hover { text-decoration: underline; }

 

 #rating_btns { position: relative; z-index: 100; width: 140px; height: 21px;}
 #rating_btns ul, #rating_btns li  { padding: 0; margin: 0; }
 #rating_btns li { float: left; width: 14px; height: 21px; display: block; font-size: 1px; cursor: pointer; color: #1e1d1c;
  }
</style>
</head>
<body>
<p id="demo">
 <p id="rating_cont">  
  <p id="rating_btns">
   <ul>
    <li>0.5</li>
    <li>1.0</li>
    <li>1.5</li>
    <li>2.0</li>
    <li>2.5</li>
    <li>3.0</li>
    <li>3.5</li>
    <li>4.0</li>
    <li>4.5</li>
    <li>5.0</li>
   </ul>
  </p> 
  <p id="rating_on" > </p>
  <p id="rated">
   <p id="rating" style="height: 17px; line-height: 17px;">not rated</p>
   <p> -  </p>
   <p id="small_stars"> </p>
   <p id="rate_edit">edit</p>
  </p>  
 </p>
 <input type="hidden" id="rating_output" name="rating_output" value="not rated" />
</p><br />
<br />

</body>
</html>