無限スクロールに関するこの指示に従って、ページ 2、3、4 などから新しいコンテンツを非表示にして、読み込みが終了してからアニメーション化することができました。今、私はこれらと同じ効果を達成したいと考えていますが、メインコンテンツでは、最初のページは何でしょう. 何か助けはありますか?私が使用しているコード:
<script>
$(function(){
var $container = $('#boxes');
$container.imagesLoaded( function(){
$container.isotope({
itemSelector : '.box'
});
});
</script>
<script>
$('#boxes').isotope({
// options
itemSelector : '.box',
layoutMode : 'masonry'
masonry : {
columnWidth : 325
},
});
</script>
<script>
$(function(){
var $container = $('#boxes');
$container.imagesLoaded(function(){
$container.isotope({
itemSelector: '.box'
});
});
$container.infinitescroll({
navSelector : '#navigation',
nextSelector : '#navigation a#next',
itemSelector : '.box',
loading: {
finishedMsg: 'no more pages to load.',
img: 'http://i.imgur.com/qkKy8.gif'
}
},
function(newElements){
var $newElems = jQuery( newElements ).hide()
console.log('Elements Retrieved:');
var $newElems = $(newElements);
$container.imagesLoaded(function(){
$newElems.fadeIn(); // fade in when ready
$container.isotope('appended', $newElems, function(){console.log('Appended');});
});
});
});
</script>
そして、ここにブログがあります。前もって感謝します!