tinymce 如何才能高度自动满屏?

2016-04-20 03:45:51 +08:00
 oglop

问题发这了,还没人回 http://community.tinymce.com/forum/viewtopic.php?id=36512

3044 次点击
所在节点    JavaScript
3 条回复
oglop
2016-04-20 05:16:00 +08:00
```
function doresize(){
var ht = window.innerHeight;
console.log("ht = " + ht);

if (document.getElementsByClassName('mce-toolbar-grp')){
ht += -document.getElementsByClassName('mce-toolbar-grp')[0].offsetHeight;
ht += -document.getElementsByClassName('mce-toolbar-grp')[0].offsetTop;
console.log("ht = " + ht);
}
if (document.getElementsByClassName('mce-statusbar')){
ht += -document.getElementsByClassName('mce-statusbar')[0].offsetHeight;
console.log("ht = " + ht);
}

ht += -3; // magic value that changes depending on your html and body margins

if (document.getElementsByClassName('mce-edit-area')){
document.getElementsByClassName('mce-edit-area')[0].style.height = ht + "px";
console.log("ht = " + ht);
}

}

window.onresize=doresize;
window.onload=doresize;
```

这样可以但是很挫,能用 css 解决么
oglop
2016-04-20 05:16:49 +08:00
话说为啥有时候回复用 markdown 格式可以,有时候不行
test `test`
loggerhead
2016-04-20 09:21:59 +08:00
@oglop 回复从来都不支持 markdown ……只有发帖支持,而且只支持部分 markdown 特性

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/272420

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX