jQuery Star Rating Plugin - Test Suite

This is a template you can use to test your integration of this plugin.

This test page uses the plugin release hosted here:
http://www.fyneworks.com/jquery/star-rating/jquery.rating.js

Container + 'stars' option

As proposed in issue 10 on github repo

CODE RESULT
      <div class="star-container"></div>
      <script>$(function(){ $('#star-container').rating({stars:5}); })</script>
      
      <div class="star-container-split"></div>
      <script>$(function(){ $('#star-container-split').rating({stars:10,split:2}); })</script>
      
      $('<div/>').rating({
        stars:5,
        callback: function(v){
          alert(v)}
        }
      ).appendTo('#widgets-on-the-fly')
      
      $('<div/>').rating({
        stars:5,
        values: ['A','B','C','D','E'],
        callback: function(v){
          alert(v)}
        }
      ).appendTo('#widgets-on-the-fly')
      



Dynamically inserted controls

This will work even if they have the same name or the name attribute has not been defined.
NB.: If you don't use the name attribute the browser will not submit any values




$().rating('select', index / value)

Use this method to set the value (and display) of the star rating control via javascript. It accepts the index of the star you want to select (0 based) or its value (which must be passed as a string.

Example: (values A/B/C/D/E)


By index: eg.: $('input').rating('select',3)
By value: eg.: $('input').rating('select','C')



$().rating('readOnly', true / false)

Use this method to set the value (and display) of the star rating control via javascript. It accepts the index of the star you want to select (0 based) or its value (which must be passed as a string.

Example: (values 1,2,3...10)


eg.: $('input').rating('readOnly',true)
eg.: $('input').rating('readOnly',false) or simply $('input').rating('readOnly');



$().rating('disable') / $().rating('enable')

These methods bahve almost exactly as the readOnly method, however they also control whether or not the select value is submitted with the form.

Example: (values 1,2,3...10)


eg.: $('input').rating('disable')
eg.: $('input').rating('enable');