1-5 (or 1-n
) star rating in < 75 lines of code.
- jQuery
<div class='starrr'></div>
$('.starrr').starrr()
$('.starrr').starrr({
rating: 4
})
$('.starrr').starrr({
max: 10
})
$('.starrr').starrr({
readOnly: true
})
$('.starrr').starrr({
change: function(e, value){
alert('new rating is ' + value)
}
})
Or if you prefer events:
$('.starrr').on('starrr:change', function(e, value){
alert('new rating is ' + value)
})
npm install
npm install -g grunt-cli
- Make changes in
src/
- Run
grunt
to compile them
MIT