Minimal Emoji Rating Plugin With jQuery - Emoji Ratings

Minimal Emoji Rating Plugin With jQuery - Emoji Ratings
File Size: 62.6 KB
Views Total: 3013
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Emoji Ratings is a simple, lightweight jQuery star rating plugin that uses emoji unicode characters for rating symbols.

Basic usage:

1. Load the jquery.emojiRatings.js script after loading jQuery library but before you close the body tag.

<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="src/jquery.emojiRatings.js"></script>

2. Create a wrapping element for the rating plugin.

<div id="element"></div>

3. Call the emojiRating() method to initialize the rating plugin with default options. The plugin will generate a hidden input with the name specified in the JavaScript (default: rating).

$("#element").emojiRating({
  // options here
});

4. Plugin's default settings.

$("#element").emojiRating({

  // Unicode
  emoji: "U+2B50",

  // the number of stars
  count: 5,

  // font size
  fontSize: 16,

  // input name
  inputName: "rating",

  // callback
  onUpdate: null
  
});

5. Emoji dictionary.

  • smile: "U+1F603",
  • wink: "U+1F609",
  • laughing: "U+1F606",
  • blush: "U+1F60A",
  • heart_eyes: "U+1F60D",
  • kissing_heart: "U+1F618",
  • heart: "U+2764",
  • heart_with_arrow: "U+1F498",
  • broken_heart: "U+1F494",
  • tongue_out_wink: "U+1F61C",
  • tongue_out_eyes_closed: "U+1F61D",
  • angry: "U+1F620",
  • crying: "U+1F622",
  • scream: "U+1F631",
  • pray: "U+1F64F",
  • poo: "U+1F4A9",
  • star: "U+2B50"

Change log:

2016-03-17

  • Added onUpdate callback

2016-03-10

  • Added shortname dictionary with 16 emojis

This awesome jQuery plugin is developed by gellerby. For more Advanced Usages, please check the demo page or visit the official website.