Internet Explorer中预期的jQuery对象(IE8和 – )

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

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

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

但我找不到什么是错的。

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不支持此功能

请参阅此处获取支持图表。

您可以使用这样的替代方案。