Created
November 29, 2011 22:28
-
-
Save KyleAMathews/1406877 to your computer and use it in GitHub Desktop.
jQuery plugin for making textareas auto-exapand. Based on article at http://www.alistapart.com/articles/expanding-text-areas-made-elegant/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ = jQuery | |
$.fn.makeExpandingArea = () -> | |
@.each -> | |
container = $(@) | |
area = container.find('textarea') | |
span = container.find('span') | |
area.on 'input', -> | |
span.text(area.val()) | |
span.text(area.val()) | |
# Enable extra CSS | |
container.addClass('active') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment