Demo running TwitLimit 0.2.0

Documentation
Download

Demo 1:

This example is using all default options of TwitLimit.

$(document).ready(function(){
$('#limitThis').twitLimit({}); });


Demo 2:

This example modifies the "message" option (%1 is used because it is replaced by the number characters left) and the "counterElem" which is where the message is displayed.

$(document).ready(function(){
$('#limitThis2').twitLimit({
message: 'You have %1 Characters left!', counterElem: '#limit2', allowNegative: true });
});


Demo 3:

This example disables "dangerMode", so the number of characters left won't go from dark to medium to bright red. It also adds listeners for when the count goes negative (it disables the submit button) and when it returns positive (it enables the submit button).

$(document).ready(function(){
$('#limitThis3').twitLimit({
counterElem: '#limit3', allowNegative: true, dangerMode: false, onNegative: function(){ $('#submit-button').attr('disabled', 'disabled'); }, onPositive: function(){ $('#submit-button').removeAttr('disabled'); } });
});


Demo 4:

This demo changes the colors of the count changes and does not change the count bold (when 20 characters or less left) when dangerMode is enabled.

$(document).ready(function(){
$('#limitThis4').twitLimit({
counterElem: '#limit4', dangerBold: false, dangerColors: { dark: '5b04dd' medium: '3d0fe9' bright: '374aff' } });
});