GithubHelp home page GithubHelp logo

simonemyrrha / jquery-emoji-ratings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gellerby/jquery-emoji-ratings

0.0 2.0 0.0 885 KB

Emoji Ratings jQuery plugin for adding a emoji based rating input field to any form

JavaScript 100.00%

jquery-emoji-ratings's Introduction

jQuery Emoji Ratings

jQuery Emoji Ratings

Browser Support

Latest Browser Support Tables from caniemoji.com

Setup

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="dist/jquery.emojiRatings.min.js"></script>

Usage

$('#yourElement').emojiRating(options);

Options

// Defaults
options = {
	emoji: 'U+2B50',
	count: 5,
	fontSize: 16,
	inputName: 'rating',
	onUpdate: function() {}
}

Emoji

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 ๐Ÿค—

Lookup Unicode Entity

emoji: 'poo' //Default: 'star' or 'U+2B50' โญ

Count

count: 10 //Default: 5

Font Size

fontSize: 100 //Default: 16

Input Name

Will generate a hidden input with the name specified

<input type="hidden" name="{{inputName}}" value="{{selectedIndex}}" />
inputName: 'product-rating' //Default: "rating"

onUpdate Callback

Called every time a rating is selected or updated with optional value

onUpdate: function(rating) {
	console.log(rating);
}

TODOs

  • Add docs on styling with CSS
  • More callbacks/event hooks
  • Tests for callbacks/event hooks

jquery-emoji-ratings's People

Watchers

James Cloos avatar Simone Myrrha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.