Try this I have edited your code,It works
var index=1;
$(".beeRating li").on({
mouseover: function() {
if(index==1)
{
$(this).addClass('stop');
$("li").each(function(index,domEle) {
$(domEle).css('opacity', '1');
if( $(this).hasClass('stop') ) {
return false;
}
})
}
},
mouseleave: function() {
if(index==1)
{
$(this).removeClass('stop');
$("li").each(function(index,domEle) {
$(domEle).css('opacity', '.25');
})
}
},
click: function() {
var rating = $(this).attr('id');
console.log(rating);
index=0;
$.ajax({ //call the function to do ajax request or do it here itself
url: "<your url>"
}).done(function() { // important !! on done set the index as 1
alert("success");
index=1;
});
}
});
Hope this helps, Thank you