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>
推荐阅读
-
jQuery插件zTree实现的多选树效果示例
-
JQuery实现文字无缝滚动效果示例代码(Marquee插件)
-
jQuery插件zTree实现删除树节点的方法示例
-
jQuery插件zTree实现的基本树与节点获取操作示例
-
jQuery插件zTree实现删除树子节点的方法示例
-
jQuery插件FusionCharts实现的MSBar2D图效果示例【附demo源码】
-
jQuery插件FusionCharts实现的Marimekko图效果示例【附demo源码】
-
jQuery插件zTree实现更新根节点中第i个节点名称的方法示例
-
jQuery插件zTree实现单独选中根节点中第一个节点示例
-
jQuery插件HighCharts绘制的基本折线图效果示例【附demo源码下载】