Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 砌体重叠(不平衡2缺陷)_Javascript_Jquery_Wordpress_Masonry - Fatal编程技术网

Javascript 砌体重叠(不平衡2缺陷)

Javascript 砌体重叠(不平衡2缺陷),javascript,jquery,wordpress,masonry,Javascript,Jquery,Wordpress,Masonry,我用Wordpress.org建立了我的网站,主题叫不平衡2。我注意到这个主题有一个bug,我搜索了一些关于重叠问题的主题,因为它是js。我使用从用户Leger处下载的图像,谢谢!:它工作,但有时我的铬仍然重叠。我决定添加分页,而不是延迟加载,以避免更多的问题…但我不能合并为框和相关 你能帮帮我吗 非常感谢您的时间 此调整是对chrome和safari浏览器的修复 添加这一行 jQueryimg.loadfunction{ jQuery.container_class.mashise;//此调整

我用Wordpress.org建立了我的网站,主题叫不平衡2。我注意到这个主题有一个bug,我搜索了一些关于重叠问题的主题,因为它是js。我使用从用户Leger处下载的图像,谢谢!:它工作,但有时我的铬仍然重叠。我决定添加分页,而不是延迟加载,以避免更多的问题…但我不能合并为框和相关

你能帮帮我吗

非常感谢您的时间


此调整是对chrome和safari浏览器的修复

添加这一行

jQueryimg.loadfunction{ jQuery.container_class.mashise;//此调整是对chrome和safari浏览器的修复
};

这里是我找到的解决方案。正如我所说的,我改变了分页的延迟负载,我编写了下面的代码,这要感谢一些在这个论坛上分享他们解决方案的用户

<script src="http://imagesloaded.desandro.com/imagesloaded.pkgd.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {

// grid
var $boxes = $('.box');
$boxes.hide();

var $container = $('#boxes');
$container.imagesLoaded( function() {
$boxes.fadeIn();

$('#boxes').masonry({
    itemSelector: '.box',
    columnWidth: 286,
    gutterWidth: 40
});
});

var $container = $('#related');
$container.imagesLoaded( function() {
$('#related').masonry({
    itemSelector: '.box',
    columnWidth: 286,
    gutterWidth: 40
});
});

});
</script>

哈罗·达米克:非常感谢你的回答!但是我不知道如何添加这一行,我是js的初学者。如果我把它放在var$box=$'.box'之前;砌石不起作用。也许我必须加上这一行,而不是图片?你能帮我做这个吗?提前谢谢!
<script src="http://imagesloaded.desandro.com/imagesloaded.pkgd.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {

// grid
var $boxes = $('.box');
$boxes.hide();

var $container = $('#boxes');
$container.imagesLoaded( function() {
$boxes.fadeIn();

$('#boxes').masonry({
    itemSelector: '.box',
    columnWidth: 286,
    gutterWidth: 40
});
});

var $container = $('#related');
$container.imagesLoaded( function() {
$('#related').masonry({
    itemSelector: '.box',
    columnWidth: 286,
    gutterWidth: 40
});
});

});
</script>