使用 jQuery Masonry IsAnimatedFromBottom
目前,当我将新项目附加到砖石容器时,它们会添加到左上角,然后飞到适当的位置。但是,在砌体网站的此示例中,新元素出现在底部。
它在演示描述中说演示“使用 IsAnimatedFromBottom 标志”,但查看代码我看不到它:
<script>
$(function(){
var $container = $('#container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.box',
columnWidth: 100
});
});
$container.infinitescroll({
navSelector : '#page-nav', // selector for the paged navigation
nextSelector : '#page-nav a', // selector for the NEXT link (to page 2)
itemSelector : '.box', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/6RMhx.gif'
}
},
// trigger Masonry as a callback
function( newElements ) {
var $newElems = $( newElements );
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
$container.masonry( 'appended', $newElems, true );
});
}
);
});
</script>
同时查看列出的 options 它似乎没有列出,所以有人知道它是如何使用的吗?
Currently when I append new items to my masonry container they are added in the top left corner and then fly into position. However, in this example on the masonry website the new elements appear at the bottom.
It says in the demo description that the demo 'makes use of the IsAnimatedFromBottom flag', but looking at the code I can't see it:
<script>
$(function(){
var $container = $('#container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.box',
columnWidth: 100
});
});
$container.infinitescroll({
navSelector : '#page-nav', // selector for the paged navigation
nextSelector : '#page-nav a', // selector for the NEXT link (to page 2)
itemSelector : '.box', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/6RMhx.gif'
}
},
// trigger Masonry as a callback
function( newElements ) {
var $newElems = $( newElements );
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
$container.masonry( 'appended', $newElems, true );
});
}
);
});
</script>
Also looking at the listed options it doesn't appear to be listed, so does anyone know how this is used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己也遇到了一些麻烦。我认为你实际上想将标志设置为 true 所以而不是
你想要
Was having some trouble with this myself. I think you actually want to set the flag to true so instead of
you would want
抱歉,总是这样,一发帖就找到答案了!该标志不是配置设置,而是附加方法的参数
Sorry, always the way, found the answer as soon as I posted! The flag isn't a config setting, but a parameter for the appended method