Pie*_*rre 10 javascript codemirror
我在选项卡式界面中使用带有textareas的codemirror,当我不在包含codemirror的选项卡中然后转到它时,我得到没有行号或光标的空白空间,当我刷新它工作的页面时,我知道这是因为标签内容是隐藏的,display: none;所以我该如何解决这个问题呢?
这是我的代码,(我也使用jquery):
var editor = CodeMirror.fromTextArea(document.getElementById($this.attr('id')), {
lineNumbers: true,
mode: text/html,
enterMode: "keep",
tabMode: "shift"
});
$(editor.getScrollerElement()).width(300);
width = $(editor.getScrollerElement()).parent().width();
$(editor.getScrollerElement()).width(width);
editor.refresh();
Run Code Online (Sandbox Code Playgroud)
提前致谢.
Amr*_*ero 10
试试这个 :
// Refresh CodeMirror
$('.CodeMirror').each(function(i, el){
el.CodeMirror.refresh();
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10635 次 |
| 最近记录: |