Like DisLike Voting Plugin With jQuery - thumbs.js

Like DisLike Voting Plugin With jQuery - thumbs.js

thumbs.js is a really simple jQuery plugin for creating a Like/Dislike voting system with thumb icons to rate your posts, articles or products.

How to use it:

1. Place the required stylesheet jquery.thumbs.css in the header, and the JavaScript file jquery.thumbs.js after jQuery library as this:

<link rel="stylesheet" href="dist/jquery.thumbs.css">
<script src="//"></script>
<script src="dist/jquery.thumbs.js"></script>

2. Create a DIV contaienr for the voting system and specify the initial rating values using data-like and data-dislike attributes:

<div class="js-rating" data-like="8" data-dislike="2"></div>

3. Initialize the voting system.


4. Default plugin options.

  classCss: 'jq-rating',
  likes: 1,
  dislikes: 1

5. Callback functions.

  onLike: function (value) {
      alert ('Thank You For Voting.');
  onDislike: function(value) {
     alert ('Im sorry.');

6. API methods.

// set likes to 5
// set Dislikes to 5
// get likes
// get dislikes
// destroy



  • v1.0.4

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

  • Publication date: 14.09.2018
  • Source