user1896653
user1896653

Reputation: 3327

How to get half/partial star rating

I've used jquery star rating at a website. I used this plugin to do this. At one page, I've to make the star rating read-only mode and now I need star will be shown with half/partial state according to "average" value like this image:

I saw this feature at that plugin's demo. This is their demo link. I though by using average: 0.42 at jQuery makes the star partial automatically like the demo. But, it didn't do that. I can't find any other option to do this at their documentation. So, how can I make the star rating image partial according to value?

My fiddle

jQuery:

$('.starbox').starbox({
    average: 0.42
});

Upvotes: 1

Views: 3560

Answers (1)

speak
speak

Reputation: 5382

I used

$('.starbox').starbox({
    average: 0.48,
    changeable: false // turning the rating into read-only mode
});

And it gave me partial stars just fine. Adjust the value and it'll go up or down in increments.

Upvotes: 2

Related Questions