Does anyone here who familiar with jquery raty?
is theres a way to callback the cancel button?
here's my code
$(".ratings").raty({
cancel: function() {
return $(this).attr("data-cancel");
}
});
I want something like that. But my code seems not working.
Try using the code from my example below. You see a callback function for the click event. Because it will be executed on all clicks, you have to find a way to only execute some code when the cancel button is clicked. In my example you see this check is done based on the class name of the clicked element.
In the callback function the
alert("Score: " + score);
returns null, so when it reaches this method, the score has already been removed due to clicking the cancel button.