TinyMCE editor fixed size with no scrollers?

前端 未结 5 1983
长情又很酷
长情又很酷 2021-01-18 14:48

At the moment I have this:

    tinyMCE.init({
// General options
mode : \"exact\",
elements : \"fkField, lkField, ukcField, khField\",
theme : \"advanced\",
         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 15:08

    You will need to write an own plugin. Check the editor height on each Keystroke (you may use the built in tinymce event onKeyUp). If the heigth changes remove the last inserted code.

    EDIT: Howto get the current editor iframe heigth

        var currentfr=document.getElementById(editor.id + '_ifr');
        if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
            currentfr.height = currentfr.contentDocument.body.offsetHeight + 26;
        }
        else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
                currentfr.height = currentfr.Document.body.scrollHeight;
        }
    

提交回复
热议问题