jQuery Raty星级评分插件使用方法

   $('.stars').raty({
      'starHalf'    : '/static/public/raty/lib/images/star-half.png'  ,                              // The name of the half star image.
       'starOff'     : '/static/public/raty/lib/images/star-off.png'     ,                            // Name of the star image off.
       'starOn'      : '/static/public/raty/lib/images/star-on.png',
       score: function() {
         return $(this).attr('data-score');
       },
       click: function(score, evt) {
         $.post("./index.php?crm/score",{id:this.id,score:score},function(data){
                           if(!data.status){
                                 alert(data.message);
                               }
          },"json")
       }
      });

主要参考了以下这篇文章

 

项目地址:

https://github.com/wbotelhos/raty

你可能感兴趣的:(jQuery Raty星级评分插件使用方法)