Coder Social home page Coder Social logo

arslanserkan / jquery-simply-countable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaronrussell/jquery-simply-countable

0.0 1.0 0.0 308 KB

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

Home Page: http://github.com/aaronrussell/jquery-simply-countable/

JavaScript 100.00%

jquery-simply-countable's Introduction

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.

jquery-simply-countable's People

Contributors

aaronrussell avatar ryanwood avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.