本文实例讲述了JS实现带提示的星级评分效果。分享给大家供大家参考,具体如下:
这是一款JS仿淘宝网的星级评分系统,鼠标放在上边可以显示星级代表的评分级别,鼠标点击时会选中当前的星级,目前此功能在网页上十分流行,虽然是仿做的,但已经很不错的功能了,希望大家喜欢!
运行效果截图如下:
在线演示地址如下:
http://demo.jb51.net/js/2015/js-start-level-pf-codes/
具体代码如下:
星级评分系统 body,div,ul,li,p{margin:0;padding:0;} body{color:#666;font:12px/1.5 Arial;} ul{list-style-type:none;} #star{position:relative;width:600px;margin:10px auto;} #star ul,#star span{float:left;display:inline;height:19px;line-height:19px;} #star ul{margin:0 10px;} #star li{float:left;width:24px;cursor:pointer;text-indent:-9999px;background:url(images/star.png) no-repeat;} #star strong{color:#f60;padding-left:10px;} #star li.on{background-position:0 -28px;} #star p{position:absolute;top:20px;width:159px;height:60px;display:none;background:url(images/icon.gif) no-repeat;padding:7px 10px 0;} #star p em{color:#f60;display:block;font-style:normal;} 点击星星就能打分
- 1
- 2
- 3
- 4
- 5
希望本文所述对大家Javascript程序设计有所帮助。



