Skip to content

Instantly share code, notes, and snippets.

@ekashida
Created May 22, 2010 07:13
Show Gist options
  • Save ekashida/409865 to your computer and use it in GitHub Desktop.
Save ekashida/409865 to your computer and use it in GitHub Desktop.
function resizeTextarea () {
while (this.get("scrollHeight") > this.get("offsetHeight")) {
this.set("rows", this.get("rows") + 1);
}
while (this.get("rows") > 3 && this.get("scrollHeight") < this.get("offsetHeight")) {
this.set("rows", this.get("rows") - 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment