raty
raty copied to clipboard
$('selector').raty('score') doesn't work
I choose one and a half stars, but the method returns a value of "4.551389058430989".
... click: function(){ setTimeout(function(){ console.log($('selector').raty('score')); }, 200); }
This crutch solves the problem. But option "click" has to be fixed.
Use the code from master.
I am using the latest code from master and it doesn't fix this issue.
$('.raty').raty({
starType: 'i' ,
path: '/web/library/raty/images/',
half: true,
click: function(event) {
var rate = $('.raty').raty('score');
$.ajax({
async: false,
type: 'post',
dataType: 'json',
data: {rate: rate},
url: xhrSubmitRating,
success: function(data){
}
});
}
});