2013-08-08 17:01:56 +08:00
|
|
|
$(document).ready(function(){
|
|
|
|
$(".rateable").jRating({
|
|
|
|
//default options displayed below ->
|
|
|
|
|
|
|
|
rateMax: 5, //Maximal rate
|
|
|
|
length : 5, //Number of stars
|
|
|
|
//decimalLength : 0, //Number of decimals in the rate
|
|
|
|
//type : 'big', //Big or small
|
|
|
|
//step : true, //If set to true, filling of the stars is done star by star (step by step).
|
|
|
|
//isDisabled: false, //Set true to display static rating
|
|
|
|
//showRateInfo:false, //Rate info panel, set true to display
|
|
|
|
//rateInfosX : 45, //In pixel - Absolute left position of the information box during mousemove.
|
|
|
|
//rateInfosY : 5, //In pixel - Absolute top position of the information box during mousemove.
|
2014-04-23 08:46:40 +08:00
|
|
|
path : '/rateable/ratings',
|
2013-08-08 17:01:56 +08:00
|
|
|
onSuccess : function(element, rate){
|
|
|
|
//something like ->
|
2014-05-05 09:00:10 +08:00
|
|
|
alert('本次打分成功!');
|
|
|
|
//$('<span class="text-success"><small style="display:inline-block;">Thanks for rating!</small></span>').insertAfter(element)
|
2013-08-08 17:01:56 +08:00
|
|
|
},
|
|
|
|
onError : function(element, rate) {
|
|
|
|
$('<span class="text-error"><small style="display:inline-block;">You have already rated!</small></span>').insertAfter(element)
|
|
|
|
}
|
|
|
|
});
|
2014-04-21 15:41:51 +08:00
|
|
|
|
2013-08-08 17:01:56 +08:00
|
|
|
});
|