2013-04-02 91 views
1

这是我从来没有使用的浏览器上的常见问题,但它似乎仍有一些问题。当我在网站上建立一个同位素网格时,它们似乎在每个浏览器中都能正常工作,但是当我使用http://netrenderer.com来测试IE时,它不能布置div,而是它们都卡在浏览器的左侧。我试图找到一个jQuery方法来启动同位素/砌体布局等跨浏览器友好(特别是IE)。
下面是的jsfiddle一个简单的样机:http://jsfiddle.net/73Xv7/3/
和现场演示版本太多:http://jsfiddle.net/73Xv7/3/show/
的jQuery:jQuery同位素:IE无法加载

var jQuerycontainer = jQuery('#main-grid'); 

jQuerycontainer.imagesLoaded(function(){ 
jQuerycontainer.isotope({ 
    itemSelector: '.grid-block', 
    animationEngine: 'best-available', 
    masonry: { 
    columnWidth: 4 
    } 
}); 
    }); 

别的东西,我试过了身体设置为display: none,并在诸如窗口负载启动淡入所以:

(function($) { 

    $(window).load(function() { 
    $(document.body).fadeIn(1000); 
    }); 

    setTimeout(function() { 
     $('#main-grid').isotope('reLayout'); 
}, 1000); 

})(jQuery); 

为了让脚本有更多的时间加载,再次适用于所有浏览器,IE浏览器。是否有任何方法可以启动在IE中也可以工作的砌体布局?

回答

1

我试过你在IE8和IE9中的jsfiddle,它工作。我认为这可能是netrenderer.com引擎的问题。

你有没有考虑过使用布局回调函数来触发fadeIn?

$('#container').isotope({ 
    onLayout: function($elems, instance) { 
    // `this` refers to jQuery object of the container element 
    console.log(this.height()); 
    // callback provides jQuery object of laid-out item elements 
    $elems.css({ background: 'blue' }); 
    // instance is the Isotope instance 
    console.log(instance.$filteredAtoms.length); 
    } 
}); 

见:http://isotope.metafizzy.co/docs/options.html

+0

我想这对无论是 “netrenderer” 和IE 9肯定它netrenderer问题。我什至不能让它显示http://jsfiddle.net – apaul