Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seunmatt/jquery-simply-countable
jQuery plugin that provides a character counter for any text input or textarea.
https://github.com/seunmatt/jquery-simply-countable
Last synced: 3 months ago
JSON representation
jQuery plugin that provides a character counter for any text input or textarea.
- Host: GitHub
- URL: https://github.com/seunmatt/jquery-simply-countable
- Owner: SeunMatt
- Fork: true (aaronrussell/jquery-simply-countable)
- Created: 2017-03-10T18:17:18.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2015-07-13T23:42:40.000Z (over 9 years ago)
- Last Synced: 2023-02-27T19:51:56.045Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://github.com/aaronrussell/jquery-simply-countable/
- Size: 301 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
* version - 0.5.0
* homepage - [http://github.com/aaronrussell/jquery-simply-countable/](http://github.com/aaronrussell/jquery-simply-countable/)
* author - [Aaron Russell](http://www.aaronrussell.co.uk)## 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](http://www.opensource.org/licenses/mit-license.php) and [GPL](http://www.opensource.org/licenses/gpl-license.php) licenses.
Copyright (c) 2009-2013 [Aaron Russell](http://www.aaronrussell.co.uk).