$( '#star-rating-1' ).starrating({
clickFn: function( selected ) {
console.log( 'I clicked star #' + selected );
},
});
StarRating.defaults.initialText = "Rate me";
$( '#star-rating-2' ).starrating();
$( '#star-rating-3' ).starrating();
// initialText is set on the select element using the "data-options" attribute.
// e.g. data-options='{"initialText":"Rate this"}'
$( '#star-rating-4' ).starrating();
var starrating = new StarRating( document.getElementById( 'star-rating-5' ), {
clearable: false,
}).init();
star-rating.js uses gulp to build from src.
$ npm install
$ gulp
The compiled files will be saved in the dist/
folder.