Internet Explorer中预期的jQuery对象(IE8和 - ) [英] jQuery Object expected in Internet Explorer (IE8 and -)

查看:176
本文介绍了Internet Explorer中预期的jQuery对象(IE8和 - )的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE8上得到以下错误消息:预期的对象。

I get the following error message on IE8 and under: Object expected.

它适用于所有其他浏览器。

It works OK with all other browsers.

该网站是 http://www.gablabelle.com/

但是我找不到什么错误。

But I can't find what's wrong.

var layoutI = 0;
var $container = $("#stream");
var $window = $(window);
function reLayout(){  
    var mediaQueryId = getComputedStyle( document.body, ':after' ).getPropertyValue('content');
    var mediaQueryId = mediaQueryId.replace( /"/g, '' );
    var windowSize = $window.width();
    var masonryOpts;
    switch ( mediaQueryId ) {
        case 'bigger' :
            masonryOpts = {
                columnWidth: 270,
                gutterWidth: 30
            };
        break;
        case 'big' :
            masonryOpts = {
                columnWidth: 220,
                gutterWidth: 20
            };
        break;
        case 'medium' :
            masonryOpts = {
                columnWidth: 166,
                gutterWidth: 20
            };
        break;
        case 'small' :
            masonryOpts = {
                columnWidth: $container.width() / 2,
                gutterWidth: 0
            };  
        break;
    };
    $container.isotope({
        resizable: false, // disable resizing by default, we'll trigger it manually
        itemSelector : "article.post",
        animationEngine: "best-available",
        masonry: masonryOpts,
        onLayout: function() {
        //  console.log('layout!' + (layoutI++) )
            forceLoad();
            setTimeout(function(){
                html_height = $container.height();
                $("#sidebar").height(html_height - masonryOpts.gutterWidth);
            }, 500);
        }
    });
};
$container.imagesLoaded( function(){
    reLayout();
    $window.smartresize( reLayout );
});

非常感谢您的帮助。

推荐答案

错误发生在 getComputedStyle()。 IE不支持此< 8

The error is on getComputedStyle(). This is not supported by IE<8

请参阅此处支持图表。

您可以使用等替代方案这个。

这篇关于Internet Explorer中预期的jQuery对象(IE8和 - )的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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