GitXplorerGitXplorer
c

mootools-form-autogrow

public
10 stars
4 forks
2 issues

Commits

List of commits on branch master.
Unverified
3bef3b1f857a2648099c170718c4dce006454bbd

Merge pull request #10 from RiZKiT/patch-1

ccpojer committed 11 years ago
Unverified
588e317349f4bc0953269c114688c90fdda8c37c

Support more styles which influence calculation

RRiZKiT committed 11 years ago
Unverified
734c8c5512d8e0ecf64f4d47f77af43cd1a9e6bd

Break on long words. Fixes #8

ccpojer committed 12 years ago
Unverified
6f76f014acd602cee39b6d92b9bb16a9f519ef9d

Ignoring Padding in height calculation.

ccpojer committed 13 years ago
Unverified
de5de0d5149871f59fae19d6977655b417b2c96d

Updating for MooTools Forge

ccpojer committed 14 years ago
Unverified
8fd1accc1ce485a60f95fc80edfdcd48ac88841a

Adding call(this)

ccpojer committed 14 years ago

README

The README file for this repository.

Form AutoGrow

Automatically resizes textareas based on their content.

Screenshot

This Plugin is part of MooTools PowerTools!.

Build

Build via Packager, requires MooTools Core and MooTools Class-Extras to be registered to Packager already

packager register /path/to/form-autogrow
packager build Form-AutoGrow/* > form-autogrow.js

To build this plugin without external dependencies use

packager build Form-AutoGrow/* +use-only Form-AutoGrow > form-autogrow.js

Demo

See Demos/index.html

How To Use

Create a new instance of Form.AutoGrow for your TextArea-Element

new Form.AutoGrow('myTextarea');

Options

  • minHeightFactor (number, defaults to 2): The minimum textarea height based on the font-size
  • margin (number, defaults to 0): A margin to be added (subtracted) to the calculated textarea height

CSS Tips

Use the following CSS-Styles to get most out of Form.AutoGrow.

Hide the vertical scrollbar that sometimes appears in Webkit while resizing

textarea {
	overflow-y: hidden;
}

Hide the resize handle in Webkit

textarea {
	resize: none;
}

Animate the height via CSS-Transforms

textarea {
	-moz-transition-duration: 250ms;
	-webkit-transition-duration: 250ms;
	-o-transition-duration: 250ms;
	transition-duration: 250ms;
	-webkit-transition-property: height;
	-moz-transition-property: height;
	-o-transition-property: height;
	transition-property: height;
}