JavaScript Library For Form Element Autosizing – Stretchy

Category: Form , Javascript | July 30, 2018
Author: LeaVerou
Views Total: 1,920
Official Page: Go to website
Last Update: July 30, 2018
License: MIT

Preview:

JavaScript Library For Form Element Autosizing – Stretchy

Description:

Stretchy is a lightweight and zero-dependency JavaScript library that auto resizes your form elements (textareas, input fields and select boxes) accordion their content when typing.

How to use it:

Just include the minified version of stretchy in your document and done.

<script src="stretchy.min.js" async></script>

Public methods.

// Autosize one element based on its content. 
Stretchy.resize(element)

// Apply Stretchy.resize() to a collection of elements, or all Stretchy is set to apply to, if no argument is provided.
Stretchy.resizeAll(elements)

// Can Stretchy be used on this particular element? (checks if element is in the DOM, if it's of the right type and if it matches the selector filter provided by data-stretchy-selector, if the attribute is set.
Stretchy.resizes()

// Set to false to temporarily disable Stretchy.
Stretchy.active

Changelog:

07/30/2018

  • Bugfix

You Might Be Interested In:


Leave a Reply