]>
Commit | Line | Data |
---|---|---|
1 | (function(){ | |
2 | 'use strict'; | |
3 | ||
4 | $( document ).ready(function() { | |
5 | var hiddenDiv = $(document.createElement('div')); | |
6 | ||
7 | hiddenDiv.addClass('hiddendiv common'); | |
8 | ||
9 | $('body').append(hiddenDiv); | |
10 | ||
11 | $("textarea.autoresize").on('keyup', function () { | |
12 | var content = $(this).val(); | |
13 | ||
14 | content = content.replace(/\n/g, '<br>'); | |
15 | hiddenDiv.html(content + '<br class="lbr">'); | |
16 | ||
17 | $(this).css('height', hiddenDiv.height()+23); | |
18 | }); | |
19 | }); | |
20 | })(); |