0
我在一个wordpress网站上工作,并试图用石工来实现infinte卷轴。Infinte scroll/masonry出现在第一组后面的第二组图像
有问题的网页是在这里 - http://bc.somethingdoing.com/bristol-pubs-bars/?tag=pubs-2
当你向下滚动到页面底部的intitiate infinte滚动,你应该看到新的图像加载背后的旧的。
正是在此刻有点马车,但我不知道如何阻止新的图像加载existign图像
的JavaScript(JQuery的),我使用的(在functions.php中)的背后,是在这里 -
var infinite_scroll = {
loading: {
img: "<?php echo get_template_directory_uri(); ?>/images/ajax-loader.gif",
msgText: "<?php _e('Loading the next set of posts...', 'custom'); ?>",
finishedMsg: "<?php _e('All posts loaded.', 'custom'); ?>"
},
"nextSelector":"#nav-below a",
"navSelector":"#nav-below",
"itemSelector":".post",
"contentSelector":"#masonry-container",
};
jQuery(infinite_scroll.contentSelector).infinitescroll(infinite_scroll,// call Masonry as a callback
function(newElements) {
console.log(newElements);
var $newElems = jQuery(newElements).css({ opacity: 0 });
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
console.log('imagesLoded');
// show elems now they're ready
$newElems.animate({ opacity: 1 });
jQuery('#masonry-container').masonry('appended', $newElems, true);
});
}
);
我不确定它是否只是破的CSS,错位的图书馆等现在没有得到任何Javascript错误,一直在浏览铬和FF的网站,没有喜悦。
希望这足以看到什么是错的。
任何帮助非常感谢。
干杯