V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
oglop
V2EX  ›  JavaScript

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

  •  
  •   oglop · 2016-04-20 03:45:51 +08:00 · 3025 次点击
    这是一个创建于 2933 天前的主题,其中的信息可能已经有所发展或是发生改变。
    3 条回复    2016-04-20 09:21:59 +08:00
    oglop
        1
    oglop  
    OP
       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
        2
    oglop  
    OP
       2016-04-20 05:16:49 +08:00
    话说为啥有时候回复用 markdown 格式可以,有时候不行
    test `test`
    loggerhead
        3
    loggerhead  
       2016-04-20 09:21:59 +08:00
    @oglop 回复从来都不支持 markdown ……只有发帖支持,而且只支持部分 markdown 特性
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2314 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 282ms · UTC 07:00 · PVG 15:00 · LAX 00:00 · JFK 03:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.