【问题标题】:TinyMCE is glitchy/unusable in IE8TinyMCE 在 IE8 中出现故障/无法使用
【发布时间】:2010-12-24 02:48:32
【问题描述】:

我使用的是 TinyMCE 3.3.9.3 的 jQuery 版本

在 Firefox 中,它运行良好(10 秒视频描述它正在使用中):http://www.youtube.com/watch?v=TrAE0igfT3I

在 IE8 中(在 IE8 标准模式下),我无法键入或单击任何按钮。但是,如果我使用 ctrl+v 粘贴,那么我可以开始输入,但按钮仍然不起作用(描述它正在使用的 45 秒视频):http://www.youtube.com/watch?v=iBSRlE8D8F4

TinyMCE 网站上的 jQuery TinyMCE 演示适用于我的 IE8。

这是初始化代码:

$().ready(function(){

    function tinymce_focus(){
        $('.defaultSkin table.mceLayout').css({'border-color' : '#6478D7'});
        $('.defaultSkin table.mceLayout tr.mceFirst td').css({'border-top-color' : '#6478D7'});
        $('.defaultSkin table.mceLayout tr.mceLast td').css({'border-bottom-color' : '#6478D7'});
    }

    function tinymce_blur(){
        $('.defaultSkin table.mceLayout').css({'border-color' : '#93a6e1'});
        $('.defaultSkin table.mceLayout tr.mceFirst td').css({'border-top-color' : '#93a6e1'});
        $('.defaultSkin table.mceLayout tr.mceLast td').css({'border-bottom-color' : '#93a6e1'});
    }


    $('textarea.tinymce').tinymce({
        script_url : 'JS/tinymce/tiny_mce.js',
        theme : "advanced",
        mode : "exact",
        invalid_elements : "b,i,iframe,font,input,textarea,select,button,form,fieldset,legend,script,noscript,object,embed,table,img,a,h1,h2,h3,h4,h5,h6",

        //theme options 
        theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,selectall,|,undo,redo,|,cleanup,removeformat,|", 
        theme_advanced_buttons2 : "bold,italic,underline,|,bullist,numlist,|,forecolor,backcolor,|", 
        theme_advanced_buttons3 : "", 
        theme_advanced_buttons4 : "", 
        theme_advanced_toolbar_location : "top", 
        theme_advanced_toolbar_align : "left", 
        theme_advanced_statusbar_location : "none", 
        theme_advanced_resizing : false,

        //plugins
        plugins : "inlinepopups,paste",
        dialog_type : "modal",
        paste_auto_cleanup_on_paste : true,

        setup: function(ed){
            ed.onInit.add(function(ed){

                //check for addEventListener -- primarily supported by firefox only
                var edDoc = ed.getDoc();
                if ("addEventListener" in edDoc){
                    edDoc.addEventListener("focus", function(){
                        tinymce_focus();
                    }, false);

                    edDoc.addEventListener("blur", function(){
                        tinymce_blur();
                    }, false);
                }

            });
        }

    });


});

关于为什么它在 IE8 中不起作用的任何想法?

[编辑]:从 init 中删除所有内容(只留下 script_url 和主题)会导致相同的症状

【问题讨论】:

  • +1 用于添加视频链接,这确实说明了区别。

标签: jquery internet-explorer internet-explorer-8 tinymce


【解决方案1】:

我已经有一段时间没有访问此代码了,所以我在更新到 tinymce 3.4.4 后再次查看了它。

事实证明,父字段集元素同时应用了 position:relative 和 z-index:-1。删除 z-index 属性后,tinymce 就可以正常工作了。

【讨论】:

    【解决方案2】:

    如果不对特定的 html 元素添加控制,就不会有 tinymce 实例。 要么您将模式从“精确”设置为“文本区域”,要么您必须使用 tinymce.execCommand('mceAddControl',true, element_id);* 将控件添加到元素中

    【讨论】:

    • 这不只是初始化tinymce的另一种方式吗?
    • 确实,但从你的问题我认为初始化发生在 IE8 下?你有任何 js 错误吗?
    【解决方案3】:

    也许为时已晚 我遇到了同样的问题。在 ie9 和 ie7 中一切正常,但在 ie8 中无法键入或单击任何按钮

    页面上是带有内联样式的“noscrpipt”标签(我知道,ie8 和 noscript 中的背景样式存在错误 btw)

    解决方案是 - 删除 noscript 标签(或标签本身)中的内联样式,tinymce 开始完美运行

    【讨论】:

    • 不幸的是,这不是本案的问题。
    【解决方案4】:

    在编辑器初始化时检查您的 URL 中是否有 #。奇怪,但我因此遇到了一些问题。确保 URL 中没有 # 确实解决了一些与此类似的问题。希望它对你有用。

    【讨论】:

    • 不,网址中没有#。
    猜你喜欢
    • 2014-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多