1、引入jquery.js文件

2、引入jquery.raty.js

3、页面中放在这个:<span class="readOnly" data-path="images" ><i>4.5</i></span>

4、js:

function star(obj,num){
    $(obj).raty({
        path: function() {
                return this.getAttribute('data-path');//路径
         },
        readOnly: true,
        score: num    //(starr)这个4.5就是星星右边的数值
    });
};
var ac = $('.starr').find('i').text();
star('.readOnly',ac);

 

相关文章:

  • 2021-09-04
  • 2021-06-22
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2021-07-15
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案