Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
125
rated 0 times [  132] [ 7]  / answers: 1 / hits: 63080  / 15 Years ago, wed, november 25, 2009, 12:00:00

I have a TinyMCE that is set over a TextArea, and I want this editor area to ocuppy all the space of its parent div, all times.



I have a JS function that get the current space and set the textarea.style.height to it, but when I enables TinyMCE it seems to stop working.



Also, the textarea has width: 100%; it doesn't resize by HTML rendering when it's using TinyMCE too.



Any ideas?


More From » html

 Answers
24

Nowadays, you should use the autoresize plugin that comes with tinyMCE. You will have to call tinyMCE like this (jQuery version):



$('.tinymce').tinymce({
theme : 'advanced',
plugins : 'autoresize',
width: '100%',
height: 400,
autoresize_min_height: 400,
autoresize_max_height: 800,
});


I made the experience, that it may be helpful to manually call the resizing in the init_instance_callback to provide the correct height on init. Add this parameter to the passed options, if you need this:



init_instance_callback: function (inst) { inst.execCommand('mceAutoResize'); }

[#98222] Monday, November 23, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dequant

Total Points: 88
Total Questions: 99
Total Answers: 95

Location: Ukraine
Member since Sun, Dec 13, 2020
4 Years ago
dequant questions
;