Half-Star Rating Plugin

There was a request recently on the jQuery discussion list for an enhancement to Ritesh Agrawal's Simple Star Rating System to allow for 1/2 star ratings. So I took it upon myself to add the feature.


I'm not supporting my version of this plugin at this time. I meant it more as a proof of concept, an attempt to help an individual on the jQuery discussion list.

Keep in mind that this plugin does not "degrade" when the browser doesn't have JavaScript or when JavaScript is disabled. The the elements for the stars are created by the jQuery code, so when JavaScript isn't available, the elements don't appear. Therefore, if you are not absolutely certain that visitors to your site will have JavaScript available, this plugin probably isn't the best solution for you. (See Wil Stuckey's jQuery Star Rating Plugin for a degradable option.)

My addition to the plugin is pretty simple. It just adds another option to the settings, called increment, so you can do something like this now:

$('#rate1').rating('example.php', {maxvalue: 5, increment: .5});. If no increment value is set, or if it's greater than or equal to .75, the plugin will use whole-star increments. If the value is less than .75, it'll use half-star increments. Here you can see it in action:


I also updated Ritesh's demo page to include the new example: Simple (Half) Star Rating System. If you like it, you can download the files from there.

Responsive Menu
Add more content here...