0

在我找到了调整 tinyMCE 实例大小的解决方案之后(它们是只读的)。我遇到了几个小时都无法解决的问题...当我初始化tinyMCE 时,一切正常,但在Internet Explorer和早期版本的Chrome中,这不起作用

tinyMCE.init({
        mode: "textareas",
        theme: "advanced",
        readonly: true,
        theme_advanced_path: false,
        theme_advanced_resize_horizontal: false,
        autoresize: true,
        width: "870",
        setup: function(ed) {
            ed.onLoadContent.add(function(ed, o) {
                var iFrameID = "#" + ($(this).attr('id')) + "_ifr";
                $(iFrameID).height($(iFrameID).contents().find("html").height());
                //iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
            });
        }
    });

此外,我在 jQuery 之下的 Java Script 尝试也不起作用。如果有人对此有解决方案,我将非常高兴!提前致谢!

4

1 回答 1

0

这是对我有用的配置!

 tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            theme_advanced_path: false,
            theme_advanced_resize_horizontal: false,
            autoresize: true,
            readonly: true,
            width: "870",
            plugins: 'autoresize',
            autoresize_min_height: "200",
            autoresize_max_height: "50000",
            init_instance_callback: function(inst) {
                inst.execCommand('mceAutoResize');
            },
            setup: function(ed) {
                ed.onLoadContent.add(function(ed, o) {
                    var iFrameID = "#" + ($(this).attr('id')) + "_ifr";
                    $(iFrameID).contents().find("html").children().append("<base target=_blank>");

                   //The following row not works in IE - $(iFrameID).height($(iFrameID).contents().find("html").height());
                });
            }
        });
于 2013-05-07T10:53:50.710 回答