• Stars
    star
    206
  • Rank 190,504 (Top 4 %)
  • Language
    JavaScript
  • Created over 15 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

jQuery plugin that provides a character counter for any text input or textarea.

jQuery Simply Countable plugin

jQuery plugin that provides a character counter for any text input or textarea. Works when typing and pasting text using the mouse.

Usage

Simple usage:

$('#my_textarea').simplyCountable();

Advanced usage:

$('#my_textarea').simplyCountable({
    counter:            '#counter',
    countType:          'characters',
    maxCount:           140,
    strictMax:          false,
    countDirection:     'down',
    safeClass:          'safe',
    overClass:          'over',
    thousandSeparator:  ',',
    onOverCount:        function(count, countable, counter){},
    onSafeCount:        function(count, countable, counter){},
    onMaxCount:         function(count, countable, counter){}
});

Options

  • counter - A jQuery selector to match the 'counter' element. Defaults to #counter.
  • countType - Select whether to count characters or words. Defaults to characters.
  • maxCount - The maximum character (or word) count of the text input or textarea. Defaults to 140.
  • strictMax - Prevents the user from being able to exceed the maxCount. Defaults to false.
  • countDirection - Select whether to count down or up. Defaults to down.
  • safeClass - The CSS class applied to the counter element when it is within the maxCount figure. Defaults to safe.
  • overClass - The CSS class applied to the counter element when it exceeds the maxCount figure. Defaults to over.
  • thousandSeparator - The separator for multiples of 1,000. Set to false to disable. Defaults to ,.
  • onOverCount - Callback function called when counter goes over maxCount figure.
  • onSafeCount - Callback function called when counter goes below maxCount figure.
  • onMaxCount - Callback function called when in strictMax mode and counter hits maxCount figure.

License

Dual licensed under the MIT and GPL licenses.

Copyright (c) 2009-2013 Aaron Russell.

More Repositories

1

compass-rgbapng

Compass plugin for providing cross-browser compatible RGBA support by creating transparent PNGs on the fly for browsers that don't support RGBA. Uses the pure Ruby ChunkyPNG library for hassle free install and deployment.
Ruby
155
star
2

cloudapp_api

CloudApp API wrapper for Ruby, using HTTParty with an ActiveResource-like interface
Ruby
67
star
3

freeagent_api

Simple Ruby wrapper for the Freeagent Central API.
Ruby
15
star
4

jcolour

A JavaScript colour manipulation library written in CoffeeScript. jColour is inspired heavily by the SASS/Compass colour manipulation functions.
JavaScript
15
star
5

compass-vgrid-plugin

Compass compatible SASS port of the Variable Grid System. Based on the 960 Grid System.
Ruby
7
star
6

mpower

mpower is a small HTML email generation framework
Ruby
5
star
7

jquery-simply-smart-login-fields

Provides default values to login forms' username and password fields.
JavaScript
4
star
8

ee-tinymce-communicate

An ExpressionEngine extension that adds TinyMCE WYSIWYG editing to the Communicate tab.
PHP
4
star
9

pi-cam

Stream h264 video from a Raspberry Pi over the web using Apple's HLS protocol.
Shell
3
star
10

postcodeanywhere_banking

A very simple wrapper for the PostCodeAnywhere Bank Account Validation API.
Ruby
2
star
11

jquery-table-highlighter

Simple jQuery plugin that adds a class to table rows on the `hover` event.
JavaScript
2
star
12

wp-rss-cache-flusher

WP RSS Cache Flusher is a simple WordPress plugin for flushing the Magpie RSS cache from WordPress' database.
PHP
1
star
13

aql_sms_api

Ruby
1
star