我使用的是jQuery Raty,我希望得分总是在0.5的间隔内,无论它在哪里点击星号例如。0.5、1、1.5、2、2.5、3、3.5、4、4.5、5
预期结果:星形应以0.5的间隔显示
目前,代码如下所示
$('#custom_p').raty({
half: true ,
halfShow : true,
precision : true,
round : { down: .25, full: .6, up: .76 },
click: function(score, evt) {
alert('ID: ' + this.id + "\nscore: " + score + "\nevent: " + evt);
}});也许你得看一下圆形的参数
发布于 2018-11-08 16:10:54
我使用
click: function(score, evt) {
var score = Math.round(score*2)/2;
}但不是最好的方法:/
https://stackoverflow.com/questions/40108275
复制相似问题