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

 更新时间:2014年02月21日 09:20:21   作者:  
这篇文章主要介绍了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 div { 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>
<div id="demo">
 <div id="rating_cont">  
  <div 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>
  </div> 
  <div id="rating_on" >&nbsp;</div>
  <div id="rated">
   <div id="rating" style="height: 17px; line-height: 17px;">not rated</div>
   <div> - &nbsp;</div>
   <div id="small_stars">&nbsp;</div>
   <div id="rate_edit">edit</div>
  </div>  
 </div>
 <input type="hidden" id="rating_output" name="rating_output" value="not rated" />
</div>
</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 div { 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>
<div id="demo">
 <div id="rating_cont">  
  <div 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>
  </div> 
  <div id="rating_on" >&nbsp;</div>
  <div id="rated">
   <div id="rating" style="height: 17px; line-height: 17px;">not rated</div>
   <div> - &nbsp;</div>
   <div id="small_stars">&nbsp;</div>
   <div id="rate_edit">edit</div>
  </div>  
 </div>
 <input type="hidden" id="rating_output" name="rating_output" value="not rated" />
</div><br />
<br />

</body>
</html>

相关文章

  • jQuery下拉框的简单应用

    jQuery下拉框的简单应用

    这篇文章主要为大家详细介绍了jQuery下拉框的简单应用,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2016-06-06
  • BootStrap网页中代码显示<code><pre>用法详解

    BootStrap网页中代码显示<code><pre>用法详解

    网页中代码的显示,包括行中代码显示;成段的代码显示.本文给大家介绍bootstrap网页中代码显示<code><pre>用法详解,感兴趣的朋友一起看看吧
    2016-10-10
  • jquery实现简单的banner轮播效果【实例】

    jquery实现简单的banner轮播效果【实例】

    下面小编就为大家带来一篇jquery实现简单的banner轮播效果【实例】。小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-03-03
  • Bootstrap+Jquery实现日历效果

    Bootstrap+Jquery实现日历效果

    这篇文章主要为大家详细介绍了Bootstrap+Jquery实现日历效果,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2021-08-08
  • jQuery实现智能判断固定导航条或侧边栏的方法

    jQuery实现智能判断固定导航条或侧边栏的方法

    这篇文章主要介绍了jQuery实现智能判断固定导航条或侧边栏的方法,涉及jQuery针对页面元素属性的判断与动态操作相关技巧,需要的朋友可以参考下
    2016-09-09
  • jquery中的 $("#jb51")与document.getElementById("jb51") 的区别

    jquery中的 $("#jb51")与document.getElementById("

    以前没注意过,认为jquery 中的 $("#jb51") 与 document.getElementById("jb51") 是一回事,指的是同一个东西。
    2011-07-07
  • 用jquery获取自定义的标签属性的值简单实例

    用jquery获取自定义的标签属性的值简单实例

    下面小编就为大家带来一篇用jquery获取自定义的标签属性的值简单实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-09-09
  • layui表格实现代码

    layui表格实现代码

    这篇文章主要为大家详细介绍了layui表格效果的实现代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-05-05
  • jquery 简单的进度条实现代码

    jquery 简单的进度条实现代码

    jquery其实是有个进度条插件的,叫做jqueryprogressbar.js,可是想练习一下,就没有用,自己写了点代码。这个代码其实是参考别人的,因为自己的JS基础不是很好。
    2010-03-03
  • 基于jQuery实现照片墙自动播放特效

    基于jQuery实现照片墙自动播放特效

    这篇文章主要为大家详细介绍了基于jQuery实现照片墙自动播放特效,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2017-01-01

最新评论