jQuery砌体在chrome/safari中中断(堆叠图像),但仅在首次加载时 [英] jquery masonry breaks(stacks images) in chrome/safari but only on first load
问题描述
似乎当我尝试加载页面时,所有图像都堆叠在一起.但是,如果您单击链接将您带到同一页面(例如主页链接),则砌筑开始.因此,我认为砌筑加载得太早,例如在jquery准备页面或其他东西之前.
It seems that when I try to load the page, all the images are stacked on top of one another. But if you were to click a link which takes you to the same page (like the home link) then masonry kicks in. So I think masonry is loading too early, like before jquery readies the page or something.
这是我的jquery调用:
Here my jquery call:
$(document).ready(function(){
$('#image_roll_container').masonry({
itemSelector: '.box'
});
....
这是相关页面:
它在Firefox和IE8中都可以正常工作.
it works just fine in firefox and IE8.
推荐答案
我需要一个名为imagesLoaded的插件,以使Monsry脚本能够与chrome和safari之类的软件一起正常工作
looks like I needed a plugin called imagesLoaded in order for the Monsry script to work properly with the likes of chrome and safari
这篇关于jQuery砌体在chrome/safari中中断(堆叠图像),但仅在首次加载时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!