Small Custom Star Rating Plugin For jQuery Stars js - Download Small Custom Star Rating Plugin For jQuery - Stars.js

Download Small Custom Star Rating Plugin For jQuery – Stars.js

Posted on

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.

Small Custom Star Rating Plugin For jQuery Stars js - Download Small Custom Star Rating Plugin For jQuery - Stars.js
File Size: 7.04 KB
Views Total: 3365
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   



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">
2 <!-- Or use <a href="https://www.jqueryscript.net/tags.php?/Bootstrap/">Bootstrap</a>'s Glyphicons -->
3 <link rel="stylesheet" href="/path/to/bootstrap.min.css">

2. Create an empty container for the star rating system.

1 <div class="basic">
2 </div>

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.

1 $(".basic").stars();

5. Use Bootstrap’s Glyphicons for star symbols.

1 $(".basic").stars({
2   emptyIcon: 'glyphicon glyphicon-star-empty',
3   filledIcon: 'glyphicon glyphicon-star'
4 });

6. All default options which can be used to customize the rating system.

01 $(".basic").stars({
02  
03   // how many stars to display
04   stars: 5,
05  
06   // custom star icons
07   emptyIcon: 'fa-star-o',
08   filledIcon: 'fa-star',
09  
10   // star color
11   color: '#E4AD22',
12  
13   // init value
14   value: 0,
15  
16   // Array of strings, tooltips for each star
17   text: null,
18  
19   // callback function
20   click: function() {}
21    
22 });

This awesome jQuery plugin is developed by viniciusmichelutti. For more Advanced Usages, please check the demo page or visit the official website.




source : jqueryscript.net