I want to change height of tinyMCE textarea so all content will be visible without scrolling the textarea itself, but scrolling the main page.
Content of textarea is dinamically changed, so its height should be autoadjusted.
<script>
tinymce.init({
selector: "textarea",
plugins: ["code fullscreen"],
toolbar: "bold italic | alignleft aligncenter alignright alignjustify"
});
</script>
html
<form id='form1' action='?' method='post'>
<input type='text' name='title' value='<?php echo $row['title'];?>'><br>
<textarea name='content' ><?php echo $row['content'];?></textarea>
</form>
js
$('textarea').each(function() {
$(this).height($(this).prop('scrollHeight'));
});
Text area is now twice tall as its content, with a lot of blank space at the bottom.
I tried a lot of code from other posts, without success.
Any help?