I am using a jquery star rating plugin from http://www.fyneworks.com/jquery/star-rating/#tab-Testing. I would like to use decimal star rating for my application. So I am using
Test4 Half Stars and Split Stars
The html code is as below.
<input class="star {split:2}" type="radio" value="0.5" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="1.0" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="1.5" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="2.0" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="2.5" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="3.0" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="3.5" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="4.0" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="4.5" name="test-4-rating-3" />
<input class="star {split:2}" type="radio" value="5.0" name="test-4-rating-3" />
The script is as below.
$('.star').rating({
split: 2,
callback: function(value, link){
alert(value);
}
});
Please suggest me how to use {split:2} and how to get the rated value when the stars get clicked. The work will be more appreciale.
So I'm taking a shot in the dark here, because the website you linked isn't very clear, but here's what I got.
$(".star").val()
, however as you said you want to see the value when you click on the thing, you'll have to follow their instructions. $(function() { });
or putting your JS at the end of the page?