本文介绍了jQuery砌体在chrome/safari中中断(堆叠图像),但仅在首次加载时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎当我尝试加载页面时,所有图像都堆叠在一起.但是,如果您单击链接将您带到同一页面(例如主页链接),则砌筑开始.因此,我认为砌筑加载得太早,例如在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'
    });

....

这是相关页面:

http://ratattoos.com/

它在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中中断(堆叠图像),但仅在首次加载时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 04:29