This time I will share jQuery Plugin and tutorial about Small Custom Star Rating Plugin For jQuery – Stars.js, hope it will help you in programming stack.
Stars.js is a jQuery plugin for generating a star rating system that allows any icon fonts, variable star sizes, colors and init values.
Basic usage:
1. Load a icon font of your choice in the document. By default, the plugin uses Font Awesome 4 for star symbols.
1 |
< link rel = "stylesheet" href = "/path/to/font-awesome.min.css" > |
3 |
< link rel = "stylesheet" href = "/path/to/bootstrap.min.css" > |
2. Create an empty container for the star rating system.
3. Load jQuery library and the jQuery star.js plugin at the end of the document.
1 |
< script src = "//code.jquery.com/jquery-1.11.3.min.js" ></ script > |
2 |
< script src = "stars.js" ></ script > |
4. Generate a basic rating system inside the container you just created and use Font Awesome icons for star symbols.
5. Use Bootstrap’s Glyphicons for star symbols.
2 |
emptyIcon: 'glyphicon glyphicon-star-empty' , |
3 |
filledIcon: 'glyphicon glyphicon-star' |
6. All default options which can be used to customize the rating system.
07 |
emptyIcon: 'fa-star-o' , |
08 |
filledIcon: 'fa-star' , |
This awesome jQuery plugin is developed by viniciusmichelutti. For more Advanced Usages, please check the demo page or visit the official website.