Coder Social home page Coder Social logo

dung1764 / raty-fa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iovergaard/raty-fa

0.0 2.0 0.0 1.38 MB

jQuery Raty FA - A Star Rating Plugin with Font Awesome

Home Page: http://jacob87.github.io/raty-fa/

HTML 14.15% JavaScript 83.12% CSS 2.74%

raty-fa's Introduction

jQuery Raty FA - A Star Rating Plugin with Font Awesome

Description

jQuery Raty FA is a plugin that generates a customizable star rating with Font Awesome. In reality what the plugin does is to work with just about any classes on its' stars, which could be easily customized to one's own CSS classes. The plugin is a fork of the original jQuery Raty plugin by Washington Botelho.

Demo

http://jacob87.github.io/raty-fa/

Attribution

What Who
version 0.1.1
since 2014-04-10
author Jacob Overgaard
contributors Dan Jessen

Required Files

  • jquery.js

  • jquery.raty.js

  • Library of Font Awesome

Options

cancel      : false                                          // Creates a cancel button to cancel the rating.
cancelHint  : 'Cancel this rating!'                          // The cancel's button hint.
cancelOff   : 'fa fa-fw fa-minus-square'                           // Icon used on active cancel.
cancelOn    : 'fa fa-fw fa-plus-square'                            // Icon used inactive cancel.
cancelPlace : 'left'                                         // Cancel's button position.
click       : undefined                                      // Callback executed on rating click.
half        : false                                          // Enables half star selection.
halfShow    : true                                           // Enables half star display.
hints       : ['bad', 'poor', 'regular', 'good', 'gorgeous'] // Hints used on each star.
iconRange   : undefined                                      // Object list with position and icon on and off to do a mixed icons.
mouseout    : undefined                                      // Callback executed on mouseout.
mouseover   : undefined                                      // Callback executed on mouseover.
noRatedMsg  : 'Not rated yet!'                               // Hint for no rated elements when it's readOnly.
number      : 5                                              // Number of stars that will be presented.
numberMax   : 20                                             // Max of star the option number can creates.
precision   : false                                          // Enables the selection of a precision score.
readOnly    : false                                          // Turns the rating read-only.
round       : { down: .25, full: .6, up: .76 }               // Included values attributes to do the score round math.
score       : undefined                                      // Initial rating.
scoreName   : 'score'                                        // Name of the hidden field that holds the score value.
single      : false                                          // Enables just a single star selection.
size        : null                                           // The size (in pixels) of the icons that will be used.
space       : true                                           // Puts space between the icons.
starHalf    : 'fa fa-fw fa-star-half-o'                            // The name of the half star image.
starOff     : 'fa fa-fw fa-star-o'                                 // Name of the star image off.
starOn      : 'fa fa-fw fa-star'                                   // Name of the star image on.
target      : undefined                                      // Element selector where the score will be displayed.
targetFormat: '{score}'                                      // Template to interpolate the score in.
targetKeep  : false                                          // If the last rating value will be keeped after mouseout.
targetText  : ''                                             // Default text setted on target.
targetType  : 'hint'                                         // Option to choose if target will receive hint o 'score' type.
width       : false                                          // Manually adjust the width for the container.

Usage

CSS

<link href="//netdna.bootstrapcdn.com/font-awesome/latest/css/font-awesome.css" rel="stylesheet">

HTML

<div id="star"></div>

JavaScript

$('#star').raty();

Functions

$('#star').raty('score');                  // Get the current score.

$('#star').raty('score', number);          // Set the score.

$('#star').raty('click', number);          // Click on some star.

$('#star').raty('readOnly', boolean);      // Change the read-only state.

$('#star').raty('cancel', boolean);        // Cancel the rating. The last param force the click callback.

$('#star').raty('reload');                 // Reload the rating with the current configuration.

$('#star').raty('set', { option: value }); // Reset the rating with new configurations.

$('#star').raty('destroy');                // Destroy the bind and give you the raw element.

License

The MIT License

Original jQuery Raty plugin by Washington Botelho

raty-fa's People

Contributors

wbotelhos avatar iovergaard avatar eriwen avatar fsouza avatar hpgihan avatar eskimoblood avatar aprimadi avatar danielfariati avatar olegki avatar jacob87 avatar muratguzel avatar dentarg avatar rmbl avatar havvg avatar eblanshey avatar gabrielbenz avatar janapol avatar lulalala avatar

Watchers

James Cloos avatar  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.