/Starry

JavaScript star rating system based on Ajax

Primary LanguageJavaScriptOtherNOASSERTION

Starry


Starry is a JavaScript star rating system based on Ajax. Demo


Installation

You need jQuery version 1.11.0 or higher!

HTML markup:

<div id="starry" name="starry"></div>

JavaScript markup:

$(document).ready(function () {
	var starry = new Starry('#starry');
	starry.init({
		success: function (level) {
			alert('You voted: ' + level);
		}
	});
});

Options

Option Type Default Description
stars int 5 Number of rating stars. (= y)
starSize int 32 Height and width of star icons in pixel.
multiple boolean false Determines whether the user can submit several ratings.
startValue int 0 Preloaded rating. {x ∈ ℝ+ ¦ x <= y}
readOnly boolean false Determines whether the user can submit ratings.
iconPath string icons/ Path to rating icons.
tooltips array false Tooltips for the stars. (You must include tipsy!)
success function false A function to be called if the request succeeds. The function gets passed one argument: Your rating (3 for example).

Browser support

Browser Version
9 or higher
Works! Tested in version 35
Works! Tested in version 29
Not tested - Tell us!
Not tested - Tell us!

Icons (Stars)

These are the default icons:

unrated rated hover

More icons can be found here.


Cookies

Starry use cookies, to save ratings! 🍪


Download


Contributors


License

The MIT License (MIT) - View LICENSE.md

The default icons are from https://github.com/paomedia/small-n-flat!