Star Rating Feedback Plugin jQuery - Download Star Rating Feedback Plugin For jQuery - feedbackBars.js

Download Star Rating Feedback Plugin For jQuery – feedbackBars.js

Posted on

This time I will share jQuery Plugin and tutorial about Star Rating Feedback Plugin For jQuery – feedbackBars.js, hope it will help you in programming stack.

Star Rating Feedback Plugin jQuery - Download Star Rating Feedback Plugin For jQuery - feedbackBars.js
File Size: 4.15 KB
Views Total: 2972
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

feedbackBars.js is a very small jQuery plugin that lets you create a star rating feedback system with review/comment support.

How to use it:

1. Load an iconic font of your choice (e.g. Font Awesome & Bootstrap Glyphicons) for the rating symbols.

1 <link rel="stylesheet" href="/path/to/bootstrap.min.css">

2. Create the rating stars & feedback form as follows. The plugin requires a hidden input to store the rating value.

01 <div id="feedback">
02   <input class="feedback_output" type="hidden">
03   <ul class="feedback_bar">
04     <li class="feedback_starrating" x-score="1"><span class="glyphicon glyphicon-star"></span></li>
05     <li class="feedback_starrating" x-score="2"><span class="glyphicon glyphicon-star"></span></li>
06     <li class="feedback_starrating" x-score="3"><span class="glyphicon glyphicon-star"></span></li>
07     <li class="feedback_starrating" x-score="4"><span class="glyphicon glyphicon-star"></span></li>
08     <li class="feedback_starrating" x-score="5"><span class="glyphicon glyphicon-star"></span></li>
09   </ul>
10   <div class="feedback_comment_container">
11     <textarea id="feedback_comment_textarea" class="form-control longtext" rows="4"></textarea>
12   </div>
13     <a id="feedback_submit" class="btn btn-primary" href="#hurdur">Submit Feedback</a><br/>
14 </div>

3. Load jQuery library and the jQuery feedbackBars.js plugin at the end of the document.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="ratingsbar.js"></script>

4. Call the plugin to initialize the star rating feedback with customization options.

01 $("#feedback").feedback({
02  
03   // REQUIRED
04   feedback_bar : "feedback_bar",
05  
06   // initial rating value
07   deafault_score : 5,
08  
09   // CSS selector
10   output : "feedback_output",
11  
12   // comment area
13   comment_bar : {
14     container : "feedback_comment_container",
15     always_visible : false,
16     open_on : 3 // 3 stars
17   },
18  
19   // icon classes
20   on_class : "glyphicon glyphicon-star",
21   off_class : "glyphicon glyphicon-star-empty"
22    
23 });

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

source : jqueryscript.net