评星插件直接看上图:具体代码展示:html部分:CSS部分:/*网页全局样式解决兼容性问题*/body,div,p,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,table,tr,td,form,input,select,textarea,span,img,a,em,strong,*{margin:0;padding:0;}body{font-family:"宋体";字体大小:12px;color:#000000;}ul,ol,li{list-style:none;}h1,h2,h3,h4,h5,h6{font-size:14px;}input,select,textarea{vertical-align:middle;}img{border:none;垂直对齐:中间;}a{文本装饰:无;颜色:#333333;}a:hover{颜色:#009999;}.clear{clear:both;高度:0px;宽度:0px;溢出:隐藏;}正文{背景:#666;}.wrap-star,.wrap-star2{宽度:105px;高度:21px;边距:100pxauto;}.inner-star{宽度:21px;高度:21px;向左飘浮;背景:url("commstar.png")不重复0-21px;cursor:pointer;}JS部分://这部分使用了sea.js所以要特别注意//default.js部分:define(function(require,exports,module){//当前目录var$=require("./jquery.js");$(()=>{varStarProduct=(function(){varextend=function(childClass,parentClass){varB=function(){};B.prototype=parentClass.prototype;childClass.prototype=newB();childClass.prototype.constructor=childClass;}varStar=function(el,options){this.$el=$(el);this.$item=this.$el.find("li");this.opts=选项;this.add=1;this.selectEvent="鼠标悬停";}Star.prototype.init=function(){this.comStar(this.opts.num);如果(!this.opts.readyOnly){this.bindEvent();}};Star.prototype.comStar=function(num){num=parseInt(num);this.$item.each(function(ind){if(ind