tinyMCE(WYSIWYGエディタ)に問題があります。私は実際には、現在スタイル属性 "display:none"を持っているDIVのようなHTML要素の中にtextareaを追加しています。divを表示すると、hidden div内のTinyMCEが有効に表示されない
DIV表示スタイルを表示に変更するとき、tinyMCEエディタは無効になっています。
重要:この問題の原因となっている設定は、「auto_resize」オプションです。これは、tinyMCEエディタを編集モードまたは読み取り専用モードにする唯一のオプションです。ここで
は私のコードです:
tinyMCE.init({
mode: "specific_textareas",
editor_selector: /(RichTextArea)/,
theme: "advanced",
auto_reset_designmode: true,
auto_resize:true,
theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,fontselect,fontsizeselect,|,forecolor,backcolor,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_more_colors: 0,
theme_advanced_toolbar_location: "external",
theme_advanced_toolbar_align: "left"
});
...
<a href="#" onclick='document.getElementById("myHiddenDiv").style.display = "block"; return false;'>Show WYSIWYG</a><br/>
<div id="myHiddenDiv" style="display:none">
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea class="RichTextArea" id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>
<p>This is the third paragraph.</p>
</textarea>
</div>
私は、誰もがその問題を解決する方法のアイデアを持っているかどうかを知りたいですか?
を構築するようにするに
。私はしばしばそれをtinyMCEと呼びたいとは思わない。パフォーマンスの問題が発生する可能性がありますか?いいえ? – Nordes
initコールを変更する必要があるかもしれません:mode: "exact"、要素: "id_of_unhidden_div" – slolife
私はそれを試みますが、それは唯一の方法だと思います。個人的には、setTimeoutを使用して、表示サイズになると自動的にサイズを変更しました(setIntervalの一種)。しかし、それは何の理由もなくCPUを使いすぎている。 – Nordes