Skip to content

Instantly share code, notes, and snippets.

View DataZombies's full-sized avatar

Daniel J. Pinter DataZombies

View GitHub Profile
@kares
kares / jquery.autogrow.js
Created January 29, 2011 21:22
simple jQuery plugin that allows textareas to grow vertically when text is typed in
/*
* Adapted from Autogrow Textarea Plugin
* @see http://www.technoreply.com/autogrow-textarea-plugin/
*/
(function($) {
$.fn.autoGrow = function() {
return this.each(function() {
var txtArea = $(this);
var colsDefault = txtArea.attr('cols');
var rowsDefault = txtArea.attr('rows');
/**
* Here is the simplified version. Courtesy of Mike Koss.
*
* See, http://labnote.beedesk.com/the-pitfalls-of-html5-applicationcache
*/
function handleAppCache() {
if (applicationCache == undefined) {
return;
}
Code
$("button").single_double_click(function () {
alert("Try double-clicking me!")
}, function () {
alert("Double click detected, I'm hiding")
$(this).hide()
})