Skip to content

likebtn/jquery-like-button-rating

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

jQuery Like Button Rating Plugin

Sexy jQuery Like Button Rating Plugin

jQuery Like Button Rating Plugin

Live Demo

https://likebtn.com/en/jquery-like-button-rating

How To Use

Like button can be attached to any HTML element. See JSFiddle

<div data-identifier="item_1" class="like-button">Like button with identifier set using data-parameter</div>
<div data-identifier="item_2" class="like-button">One more</div>
<span id="like-button-x">For this Like button the identifier is set via options</span>
<i id="like-button-y">For this Like button the page URL is used as identifier</i>

$(document).ready(function($) {
	$(".like-button").likebtn();
    $("#like-button-x").likebtn({
    	identifier: "my_button",
        theme: "github"
    });
    $("#like-button-y").likebtn({
        theme: "disk"
    });
});

Identifier

Each button should have a unique identifier parameter (it can be understood as a button's name) to which votes are being connected. Identifier can be set:

  1. By settings data-identifier="unique_button_name" parameter for the element
    <div data-identifier="unique_button_name" class="like-button">Like button with identifier set using data-parameter</div>

	$(".like-button").likebtn();
  1. Identifier can be set via "identifier" parameter passed to likebtn() function:
	<span id="like-button-x">For this Like button the identifier is set via options</span>

    $("#like-button-x").likebtn({
    	identifier: "my_button"
    });
  1. If identifier is not set for the Like button the page's URL is used as an identifier to which votes are being connected:
    <i id="like-button-y">For this Like button the page URL is used as identifier</i>

    $("#like-button-y").likebtn({
        theme: "disk"
    });

Settings

For the full list of available options see LikeBtn Settings and Code Generator

$("#like-button-x").likebtn({
		identifier: "my_button",
    theme: "github"
});

*Powered with ♥ by LikeBtn.com*