Latest Browser Support Tables from caniemoji.com
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="dist/jquery.emojiRatings.min.js"></script>
$('#yourElement').emojiRating(options);
// Defaults
options = {
emoji: 'U+2B50',
count: 5,
fontSize: 16,
inputName: 'rating',
onUpdate: function() {}
}
Use either Unicode Entity or shortname from dictionary below
Shortname | Emoji |
---|---|
smile | ๐ |
wink | ๐ |
laughing | ๐ |
blush | ๐ |
heart_eyes | ๐ |
kissing_heart | ๐ |
heart | โค |
heart_with_arrow | ๐ |
broken_heart | ๐ |
tongue_out_wink | ๐ |
tongue_out_eyes_closed | ๐ |
angry | ๐ |
crying | ๐ข |
scream | ๐ฑ |
pray | ๐ |
poo | ๐ฉ |
star | โญ |
thinking | ๐ค |
hugging | ๐ค |
emoji: 'poo' //Default: 'star' or 'U+2B50' โญ
count: 10 //Default: 5
fontSize: 100 //Default: 16
Will generate a hidden input with the name specified
<input type="hidden" name="{{inputName}}" value="{{selectedIndex}}" />
inputName: 'product-rating' //Default: "rating"
Called every time a rating is selected or updated with optional value
onUpdate: function(rating) {
console.log(rating);
}
- Add docs on styling with CSS
- More callbacks/event hooks
- Tests for callbacks/event hooks