jRating, very flexible jQuery plugin for quickly creating an Ajaxed star rating system.

jRating description

jRating is a very flexible jQuery plugin for quickly creating an Ajaxed star rating system. It is possible to configure every detail from" the number of the stars" to "if the stars can represent decimals or not".

There is also an option to display small or big stars and images can be changed with any other file easily.

Although the plugin can be used with any scripting language, a PHP file that handles the requests is already included in the download package.

jRating download package

  • jRating v2.2
    • jquery
      • jquery.js
      • jRating.jquery.css
      • jRating.jquery.js
      • jRating.jquery.min.js
      • icons
        • stars.png
        • small.png
        • bg_jRatingInfos.png
    • php
      • jRating.php
    • index.php

jRating implementation

1. First, include the CSS & jQuery files

<!-- include CSS & JS files --> <!-- CSS file --> <link rel="stylesheet" type="text/css" href="jRating.jquery.css" media="screen" /> <!-- jQuery files --> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jRating.jquery.js"></script>

2. Add your HTML !

<!-- basic exemple --> <div class="exemple"> <!-- in this exemple, 12 is the average and 1 is the id of the line to update in DB --> <div class="basic" id="12_1"></div> <!-- in this other exemple, 8 is the average and 2 is the id of the line to update in DB --> <div class="basic" id="8_2"></div> </div>

3. Now, call the jRating plugin

<script type="text/javascript"> $(document).ready(function(){ // simple jRating call $(".basic").jRating(); // more complex jRating call $(".basic").jRating({ step:true, length : 20, // nb of stars onSuccess : function(){ alert('Success : your rate has been saved :)'); } }); }); </script>

jRating options

showRateInfo
Boolean
Default :true - Disabled the rate info. Can be set to true or false
bigStarsPath
String
Default : 'jquery/icons/stars.png' - Relative path of the large star picture (stars.png).
smallStarsPath
String
Default : 'jquery/icons/small.png' - Relative path of the small star picture (small.png).
phpPath
String
Default : 'php/jRating.php' - Relative path of the PHP page (jRating.php).
type
String
Default : 'big' - Appearance type. Can be set to 'small' or 'big'.
step
Boolean
Default : false '- If set to true, filling of the stars is done star by star (step by step).
isDisabled
Boolean
Default : false '- If set to true, jRating is disabled.
length
Integer
Default : 5 - Number of star to display.
decimalLength
Integer
Default : 0 - Number of decimals in the rate.
rateMax
Integer
Default : 20 - Maximal rate.
rateInfosX
Integer
Default : - 45 - In pixel - Absolute left position of the information box during mousemove.
rateInfosY
Integer
Default : 5 - In pixel - Absolute top position of the information box during mousemove.

jRating methods

onSuccess
Function
Default : null - Callback function in case of success during rating.
onError
Function
Default : null - Callback function in case of failure during rating.

Who use jRating on the web ?

If you use jRating Plugin into your website and you want to be added here, please contact us !
We will add you with pleasure :)

How can you help us ?

If you love our work, you can show us your admiration by having a look on the ads, free for you, good for us =).THANKS !

Last News

New Plugin : Thumba

Sun 12th February

Thumbnails gallery as Google images...