How to automatic resize tinyMCE?

后端 未结 12 1470
小蘑菇
小蘑菇 2020-12-01 09:03

I have a TinyMCE that is set over a TextArea, and I want this editor area to ocuppy all the space of its parent div, all times.

I have a JS function that get the cur

12条回答
  •  借酒劲吻你
    2020-12-01 09:41

    I had the same problem, after reading this thread I ended up with this code

    init_instance_callback: function (inst) { 
      setTimeout(function () {
        document.getElementById(inst.id + '_ifr').style.height= (document.getElementById("theContainerDiv").offsetHeight-85) + 'px';
       },1000);
    },
    

    I resize the "_ifm" element instead of the "_tbl", since resizing the "_tbl" didn't resize the edit area for me. Then I leave some space for the toolbar and statusbar by making the "_ifr" 85 pixels shorter then the container div.

    I had to use setTimeout to make it work, maybe because I have an animation that displays the container element.

提交回复
热议问题