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