Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
/ jQuery-Counter Public archive
forked from webloper/jQuery-Counter

A jQuery plugin which provide character counter similar to Twitter.

License

Notifications You must be signed in to change notification settings

kofesto/jQuery-Counter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery Counter v0.1.0

A jQuery plugin which provide character counter similar to Twitter.
Used jQuery plugin boilerplate from JONATHAN NICOL :) Thanks!

jQuery Counter

Installation

Include script after the jQuery library

<script src="/path/jquery-counter.min.js"></script>

Usage

html

<div id="tweet-template"></div>

jQuery

$('#tweet-template').counter();

Options


$('#tweet-template').counter({
	limit: 			140,
	limitWarning: 	25,
	limitElement: 	'span',
	counterClass:   'counter',		
	limitClass: 	'limit',		
	warningClass: 	'warning',
	exceededClass: 	'exceeded',
	format: 		'%1'
});

  • limit: Maximum character count. Default 140
  • limitWarning: Number indicate where warning limit is on. Default 25
  • limitElement: Inline HTML element to show the left numbers of characters. Default span
  • counterClass: Class to decorate counter element . Default counter
  • limitClass: Class to decorate limit element. Default limit
  • warningClass: Class to decorate limit element in case of warning. Default warning
  • exceededClass: Class to decorate limit element in case of exceed of characters. Default exceeded
  • format: Format the output to show the rest of the characters. Default %1

To-do

  • input text and textarea support
  • word count
  • Callback Support
  • Bug fixes if any
  • JSLinting & Testing

License

Released under the MIT license
Copyright (c) 2014 Ravi Kumar

About

A jQuery plugin which provide character counter similar to Twitter.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 59.5%
  • CSS 40.5%