A simple jQuery plugin to attach up/down voting facility to selected HTML elements.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
demo.html
jquery.js
jquery.voter.js
jquery.voter.min.js
style.css

README.md

jQuery Voter Plugin

A simple jQuery plugins to attach up/down voting functionality to selected HTML element.

Basic Usage

$(selectors).attachVoter({ options });

With Up/Down Vote Callbacks

    $(selectors).attachVoter({
        "doUpVote": function(id, value) {
            //
        },
        "doDownVote": function(id, value) {
            //
        },
        "undoUpVote": function(id, value) {
            //
        },
        "undoDownVote": function(id, value) {
            //
        }
    });

Options

  • "voterClass" : "voter",
  • "wrapperClass" : "voter-wrapper",
  • "upVoteClass" : "up-vote",
  • "upVoteTitle" : "Vote Up",
  • "voteCountClass" : "vote-count",
  • "downVoteClass" : "down-vote",
  • "downVoteTitle" : "Vote Down",
  • "disabledClass" : "disabled",
  • "undoTitle" : "Click to Undo",
  • "votedClass" : "voted",
  • "plusClass" : "good",
  • "minusClass" : "bad",
  • "upVoteChar" : "▲",
  • "downVoteChar" : "▼",
  • "useCookie" : true,
  • "doUpVote" : function() {},
  • "doDownVote" : function() {},
  • "undoUpVote" : function() {},
  • "undoDownVote" : function() {}

Release Note