Skip to content

irfan/jquery-star-rating

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d3d9400 · Jul 18, 2016

History

66 Commits
Apr 15, 2012
Apr 15, 2012
Jul 12, 2016
Dec 4, 2012
Mar 27, 2012

Repository files navigation

How to use

Detailed documentation and working demo here.

Example HTML

<div class="container">
    <input type="radio" name="example" class="rating" value="1" />
    <input type="radio" name="example" class="rating" value="2" />
    <input type="radio" name="example" class="rating" value="3" />
    <input type="radio" name="example" class="rating" value="4" />
    <input type="radio" name="example" class="rating" value="5" />
</div>

Simple usage

$('.container').rating();

Using with callback method

$('.container').rating(function(vote, event){
    // console.log(vote, event);
});

Example of using ajax

$('.container').rating(function(vote, event){
    // write your ajax code here
    // For example;
    // $.get(document.URL, {vote: vote});
});