jQuery stackoverflow voting widget – Upvote

Upvote is a nice jQuery stackoverflow voting plugin, that implements voting widgets known from Stack Overflow / Stack Exchange sites.

jQuery stackoverflow voting widget in action

Upvote is a lightweight, nice and fast jQuery plugin, which allows us to create a Stack Exchange style rating UI for our web project.

jQuery stackoverflow voting plugin in action
jQuery stackoverflow voting plugin in action

Basic example:

<div id="topic" class="upvote">
    <a class="upvote"></a>
    <span class="count">0</span>
    <a class="downvote"></a>
    <a class="star"></a>


<div id="topic" class="upvote">
    <a class="upvote upvote-on"></a>
    <span class="count">6</span>
    <a class="downvote"></a>
    <a class="star"></a>


<div id="topic" class="upvote">
    <a class="upvote"></a>
    <span class="count">5</span>
    <a class="downvote"></a>
    <a class="star star-on"></a>

Initialization examples – JavaScript / jQuery:

$('#topic').upvote({count: 5, upvoted: 1});
$('#topic').upvote({count: 5, upvoted: 1, starred: 1});

Handle callback:

var callback = function(data) {
        url: '/vote',
        type: 'post',
        data: { id: data.id, up: data.upvoted, 
                down: data.downvoted, star: data.starred }

$('#topic-xyz').upvote({id: 2, callback: callback});


// Create, pick up initial values from HTML markup

// Mutators

// Getters

Options and their default values:

id          : undefined
count       : 0
upvoted     : false
downvoted   : false
starred     : false
callback    : function() {}

License: Creative Commons Attribution 3.0.

Project page:


Get jQuery stackoverflow voting plugin from GitHub:



Share:Share on Facebook2Share on Google+0Tweet about this on TwitterShare on LinkedIn1Pin on Pinterest0