dreyescat / bootstrap-rating

Bootstrap Rating is a jQuery plugin that creates a rating control that uses Bootstrap glyphicons for rating symbols.
http://dreyescat.github.io/bootstrap-rating/
MIT License
192 stars 78 forks source link

Singular Filled Icon #10

Closed jasonwbullok closed 9 years ago

jasonwbullok commented 9 years ago

Would it be possible to make the selected rating be the only filled icon?

Something along this line:

ratings-example

dreyescat commented 9 years ago

Thanks for your suggestion @jasonwbullok!

I have added a new attribute (filled-selected) to have more control over how the selected symbol is filled. With this new attribute you can customize the rating control to show a single filled icon like this:

<input type="hidden" class="rating" data-filled="glyphicon glyphicon-heart-empty" data-filled-selected="glyphicon glyphicon-heart" data-empty="glyphicon glyphicon-heart-empty"/>

Or programmatically:

$('input').rating({
  filled: 'glyphicon glyphicon-heart-empty',
  filledSelected: 'glyphicon glyphicon-heart',
  empty: 'glyphicon glyphicon-heart-empty'
});

Hope it helps.