• Stars
    star
    166
  • Rank 227,748 (Top 5 %)
  • Language
    CoffeeScript
  • Created about 9 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

Automatically adjust textarea width/height based on user input. Non-sucking version.

Automatically adjust textarea width/height based on user input.

Non-sucking version, still works great and used by a lot of people with no issues! Yes, it is old, but it works!

The only reason I wrote this jQuery plugin is that other plugins suck. They are wide-spread, but outdated and buggy.

Advantages of jquery.ns-autogrow:

  • Grows vertically, horizontally or both
  • Correctly handles 2 or more spaces
  • Copies more css and font styles to shadow div
  • Correctly handles long words on one line
  • Flickering can be disabled on Enter
  • Doesn't add more than one handler to textarea
  • Handles textarea scrollbar if any
  • Improved support of special characters

Download

Run one of these commands in your bash according to your needs.

git clone https://github.com/ro31337/jquery.ns-autogrow.git

bower install jquery.ns-autogrow

npm install jquery.ns-autogrow

Or download the latest version from the releases page.

Options

You can provide multiple options to autogrow like:

  $('.example2 textarea').autogrow({vertical: true, horizontal: false});

List of options:

Option Description
vertical (true/false) - Enable/Disable vertical autogrow (true by default)
horizontal (true/false) - Enable/Disable horizontal autogrow (true by default)
postGrowCallback Post grow callback. Executes after dimensions of textarea have been adjusted.
flickering (true/false) - Enable/Disable flickering. If flickering is disabled, extra line will be added to textarea. Flickering is enabled by default.

There are few more options reserved for debugging purposes. All debugging options start with debug prefix:

Option Description
debugx X position of shadow element (-10000 by default)
debugy Y position of shadow element (-10000 by default)
debugcolor Color of shadow element (yellow by default)

Demo

Click here

Plans:

  • Test and support arabic languages

❤️ Like it? ❤️

Star it!

The MIT License (MIT)

The MIT License (MIT)

Copyright (c) 2015 Roman Pushkin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

libretaxi

Open source Uber #deleteuber
Go
3,831
star
2

bigoposter

Big-O Complexities / Poster of common algorithms used in Computer Science
JavaScript
1,649
star
3

rubyisforfun

269
star
4

rubyschool

Rubyschool.us list of contents (Russian)
HTML
139
star
5

hacktunnel

HackTunnel is web-based peer-to-peer chat software for anonymous and encrypted communication written with Go language
JavaScript
97
star
6

libretaxi2

Open source Uber PoC #deleteuber
92
star
7

awesome-aws-alternatives

Awesome AWS alternatives/replacements
71
star
8

jQuery-Countdown-Timer

jQuery countdown timer plugin (2011)
JavaScript
60
star
9

first-visit-js

Tiny jQuery plugin to display a message to the user on the first visit to a page
JavaScript
59
star
10

rubyisforfun_ru

Руби для романтиков
33
star
11

libretaxi-www

LibreTaxi.org website html markup
HTML
20
star
12

yaask

Make your yaml configurable with interactive configurations!
JavaScript
16
star
13

gulp-react-easy

Gulp plugin to simplify React development with ES6.
JavaScript
13
star
14

exbot

Currency Exchange Bot for Telegram
JavaScript
9
star
15

wellwellapp

Sprint feedback tool we use at the end of our sprints (Meteor)
JavaScript
7
star
16

rubybook

Ruby Is For Fun - website
CSS
7
star
17

FinamTicksDownloader

Ticks Downloader for Finam.ru
C#
5
star
18

BetterRobokassa

Better support for Robokassa.ru for .Net
C#
5
star
19

pebble-meets-gopro

Pebble watch as a helper timer for GoPro action camera (under development)
C
4
star
20

zendesk-challenge

Zendesk Challenge
Ruby
4
star
21

heap-challenge

Just a random heap challenge ;)
Ruby
4
star
22

MyEnvelopeTester

Testing the theory of two envelopes with the Cover's strategy
C#
4
star
23

braintree-challenge

Braintree Challenge
Ruby
4
star
24

just-ror

Vagrant Ubuntu 14 box for just Ruby and Rails, easily customizable with nokogiri fix
Shell
4
star
25

react-boilerplate

Building TDD React boilerplate with ES6 series
JavaScript
4
star
26

tm-www

Ruby
4
star
27

RomanPushkin-RiskManager-RU

Риск-менеджер для терминала Метатрейдер 5
4
star
28

RomanPushkin-FORTS-Info

FORTS (Futures & Options on RTS) Info Indicator for Metatrader 5
3
star
29

RomanPushkin-PriceGrid

Price Grid Indicator for MetaTrader 5 (MQL)
3
star
30

hacker-rank-simpledb

HackerRank SimpleDB challenge for Thumbtack, May-June 2016
Java
3
star
31

meteor-note

Evernote inspired open source and secured notetaking app built with Meteor
3
star
32

react-easy-example1

Example for react-easy-package
JavaScript
3
star
33

RomanPushkin-DailyGrid

Daily Grid indicator for Metatrader5 (MQL)
3
star
34

predix-jpa-cf

Java Predix app example how to use Database Service with Redis Service cache
Java
3
star
35

problems-solutions

Problems and solutions
3
star
36

markdown-to-gist

Covert your markdown code snippets to gists (built for Jekyll, but can be used anywhere)
Ruby
3
star
37

RomanPushkin-HourlyGrid

Hourly Grid indicator for Metatrader5 (MQL)
3
star
38

lev-sight-words

JavaScript
2
star
39

playlistq

Watch YouTube videos together. Demo at http://playlistq.com. First draft at http://github.com/0x414f/playlistq3
JavaScript
2
star
40

math-apps

Math apps for a firstgrader
Ruby
2
star
41

screenshot_macos

ScreenCaptureKit experiments
Go
2
star
42

browser-car-detection

Simple car type detection in the browser
JavaScript
1
star