Emotion Ratings is a lightweight jQuery plugin used to create a simple rating system using custom emoji Unicode characters.
npm install emotion-ratings
Preview:
You can install emotion-ratings component using the npm package manager:
``bash`
npm install --save emotion-ratings
`html`
2. Include plugin's code:
`html`
3. Call the plugin:
`javascript``
// the emotions can be an array
var emotionsArray = ['angry','disappointed','meh', 'happy', 'inLove'];
// or a single one
var emotionsArray = ['happy'];
jQ("#element").emotionsRating({
emotionSize: 30,
bgEmotion: 'happy',
emotions: emotionsArray,
color: '#FF0066', //the color must be expressed with a css code
initialRating: 4, //initialize the rating number
disabled: true, //set if the rating can be changed or not, default is false
onUpdate: function(value) {} //set value changed event handler
});
MIT License © Yanci Nerio