【发布时间】:2016-04-07 07:55:52
【问题描述】:
我正在使用 NicEditor (http://nicedit.com)。
首先,我将 textarea 的宽度设置为 100%,但是当我调整窗口大小时,编辑器保持不变,不会调整为新的 100% 窗口宽度。
<textarea style="width: 100%;"> something .. </textarea>
<script>
//<![CDATA[
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
//]]>
</script>
我该如何解决这个问题?
编辑: 我找到了一个可行的解决方案:
$(function () {
editor = new nicEditor({fullPanel : false}).panelInstance('text');
})
$(window).resize(function() {
editor.removeInstance('text');
editor = new nicEditor({fullPanel : false}).panelInstance('text');
});
【问题讨论】:
-
在每个窗口调整大小时重新加载 niceEdit!
标签: jquery html css autoresize