I am trying to use the NicEdit editor for a text field hidden in a div. When the user clicks the button, the target parent div of targetarea is displayed. The width of the text box is set to 100% of the parent div. The problem is that the parent div is hidden, so textrea has no width before the parent div is expanded. If I try to attach the NicEdit editor while displaying its parent div, the editor will be tiny.
<script type="text/javascript"> function add_task_editor() { new nicEditor({buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','ul','link']}).panelInstance('task_description'); }; $('#trigger_it').click(function (e) { $('#parent_div').show(); add_task_editor(); }); </script> <div id="parent_div" style="display: none;"> <textarea id="task_description"></textarea> </div>
Is there any way to fix this so that the width of the editor is set to 100% of the parent div after loading it?
source share