Minimal, light-weight jQuery ratings.
jQuery Bar Rating Plugin works by transforming a standard select field into a rating widget. The rating widget can be flexibly styled with CSS. Take a look at a few examples.
Get the plugin from GitHub or install with Bower or NPM:
bower install jquery-bar-rating
npm install jquery-bar-rating
Create a select field:
<select id="example">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
If you would like to use one of the provided themes include the theme in the head section of the page.
<link rel="stylesheet" href="fontawesome-stars.css">
Include and call the plugin (after jQuery v1.7.2+)
<script src="jquery.barrating.min.js"></script>
<script type="text/javascript">
$(function() {
$('#example').barrating({
theme: 'fontawesome-stars'
});
});
</script>
The select field will be wrapped in a div with a `.br-theme-fontawesome-stars` class. For a full list of available options please refer to configuration.
Expected result:
<div class="br-wrapper br-theme-fontawesome-stars">
<select id="example">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
...rating widget...
</div>