textgauge

1.0.3 • Public • Published

TextGauge

TextGauge is a smart jQuery plugin that performs basic input length analysis on DOM text/textarea nodes allowing you to pass callback functions to fire when one of your text gauges remains within or exceeds its boundaries. Default color indicators can optionally be modified. Note: TextGauge is smart enough to use its closest span sibling!

Install via JavaScript

<script src="https://cdn.rawgit.com/Hykudoru/TextGauge/master/jquery.textgauge.js"></script>

Install via Node Package Manager

npm install textgauge

HTML Snippet

<textarea id="tg1" rows="4" cols="40"></textarea>
<span></span>

jQuery Snippet

$(document).ready(function() {
 
    $("#tg1").textgauge({
        limit: 50,
        colorPos: '#00FFFF',
        colorNeg: '#FF0000',
        onPos: function() {
            console.log("Safe");
        },
        onNeg: function() {
            console.log("Exceeded limit");
        }
    });
    
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    1
  • 1.0.2
    0
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i textgauge

Weekly Downloads

2

Version

1.0.3

License

MIT

Last publish

Collaborators

  • hykudoru