iframe - SimpleModal 在 IE 9 中不起作用(在 Iframe 内)

标签 iframe internet-explorer-9 simplemodal

使用 IE 9 时出现以下错误(Chrome 和 FireFox 效果很好):

SCRIPT438: Object doesn't support property or method 'removeExpression' jquery.simplemodal.1.4.2.min.js, line 16 character 133



Simple Modal 在 Iframe 中被调用。 jQuery.min (1.7.1) 包含在 Iframe 中 SimpleModal (1.4.2) 之前。

负责显示模态对话框的代码:
function OpenContextByClass(cssClass, posY, posX) {
    var winHeight = $(window).height();
    var winWidth = $(window).width();

    $('.' + cssClass).modal({
        overlayClose: true,
        position: [posY, posX],
        appendTo: 'form',
        onOpen: function (dialog) { dialog.overlay.fadeIn('fast', function () { dialog.container.slideDown('fast', function () { dialog.data.fadeIn('fast'); }); }); },
        onShow: function (d) {
            var self = this;
            self.container = d.container[0];
            var title = $('.' + cssClass, self.container);
            title.show();
            $('.' + cssClass, self.container).show();

            setTimeout(function () {
                var currentPositionX = posX;
                var currentPositionY = posY;
                var currentWidth = $('.' + cssClass, self.container).width() + 50;
                var currentHeight = $('.' + cssClass, self.container).height() + 50;
                posY = (currentPositionY + currentHeight) < winHeight ? currentPositionY : (winHeight - currentHeight);
                posX = (currentPositionX + currentWidth) < winWidth ? currentPositionX : (winWidth - currentWidth);

                d.container.animate(
                                { left: posX, top: posY },
                                500,
                                function () {
                                    $('.' + cssClass, self.container).show();
                                }
                            );
            }, 550);
        }
    });
}

最佳答案

我有同样的问题。我找到了这篇文章:http://help.dottoro.com/ljuvxilu.php

Internet Explorer 9 中删除了对动态属性的支持,因此不支持 getExpression、removeExpression、setExpression 和 recalc 方法。这些方法存在于版本 8 中,但使用它们会引发异常。

关于iframe - SimpleModal 在 IE 9 中不起作用(在 Iframe 内),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10782849/

相关文章:

javascript - 在 TinyMCE iframe 中加载 jQuery 文件

javascript - SimpleModal 内容仅出现在页面调整大小时

jquery - 我可以在 SimpleModal 中禁用 ESC 键关闭吗

javascript - 将内容脚本注入(inject)不同扩展名的 iframe、操作弹出窗口中?

javascript - 从数据库加载 iframe

html - 为什么我的 svg 上有一个 100% 的垂直滚动条?

html - 在ie9中获取梯度停止的效果

iframe - SimpleModal - 使用关闭按钮关闭 iframe

javascript - iframe onload 调整大小适用于 Chrome,但不适用于 IE 或 Firefox

javascript - 脚本 5 : Access is denied in IE9 on xmlhttprequest