SimpleModal在IE 9中不起作用(在iframe内部) [英] SimpleModal doesn't work in IE 9 (inside Iframe)

查看:183
本文介绍了SimpleModal在IE 9中不起作用(在iframe内部)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm getting following error when using IE 9 (Chrome and FireFox works great):


SCRIPT438:对象不支持属性或方法'removeExpression'
jquery.simplemodal.1.4.2.min.js,第16行字符133

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

简单Modal在Iframe内部调用。 jQuery.min(1.7.1)包含在Iframe中的SimpleModal(1.4.2)之前。

Simple Modal is called inside Iframe. jQuery.min (1.7.1) is included before SimpleModal (1.4.2) in the Iframe.

负责显示模态对话框的代码:

The code responsible for showing modal dialog:

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

I have got the same problem. And I found this article: http://help.dottoro.com/ljuvxilu.php

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

这篇关于SimpleModal在IE 9中不起作用(在iframe内部)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆