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.
$(".ratings").raty({
cancel : true,
click : function(score, evt) {
alert("Score: " + score);
// This is one way to check if you clicked the cancel button.
if(evt.currentTarget.className === "raty-cancel")
{
// At this point we know you clicked the cancel button,
// so insert code here to execute on callback.
}
}
});
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.