openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 30c87e63b36ad6deb493c42f31dff12b1b8b254a
parent 44b2b2cc0d84246ad495286de2f38737bcf0caf9
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 30 Oct 2012 23:41:30 +0100

Das JQuery-Plugin für Textareas fehlte noch.

Diffstat:
Athemes/default/js/plugin/jquery-plugin-orAutoheight.js | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/themes/default/js/plugin/jquery-plugin-orAutoheight.js b/themes/default/js/plugin/jquery-plugin-orAutoheight.js @@ -0,0 +1,22 @@ +/** + * Input-Hints + */ +jQuery.fn.orAutoheight = function() +{ + + var resize = function( element ) + { + var lines = $(element).val().split("\n").length; + $(element).attr('rows',lines+3); + }; + + $(this).each(function(i) + { + resize(this); + }); + + return $(this).keypress(function() + { + resize(this); + }); +}; +\ No newline at end of file