rateyo

How can I use Rate Yo jQuery star rating plugin with data attribute?

余生颓废 提交于 2019-12-07 19:41:24
问题 How can I use Rate Yo jQuery star rating plugin with data attribute? Is there any way to set a default initial value via HTML attribute? Is it possible using data-rateyo-score to pass the score value. For example, If I want to start my score depending on a dynamic value, How can I use callback for it? My code is same as below: <div class="rateYo" data-rateyo-score="1"></div> I try below code: $('.rateYo').rateYo({ score: function() { return $(this).attr('data-rateyo-score'); } }); and this: $

How can I use Rate Yo jQuery star rating plugin with data attribute?

泪湿孤枕 提交于 2019-12-06 10:39:11
How can I use Rate Yo jQuery star rating plugin with data attribute? Is there any way to set a default initial value via HTML attribute? Is it possible using data-rateyo-score to pass the score value. For example, If I want to start my score depending on a dynamic value, How can I use callback for it? My code is same as below: <div class="rateYo" data-rateyo-score="1"></div> I try below code: $('.rateYo').rateYo({ score: function() { return $(this).attr('data-rateyo-score'); } }); and this: $('.rateYo').rateYo({ score: $(this).attr('data-rateyo-score'); } }); But it seems that something is