現在、InfiniteScrollが組み込まれたDesandroのjQueryMasonryを使用するサイトを構築しています。IEを除くすべてのブラウザーで見事に動作します(IE7とIE8でも問題なく動作します)。jQuery(function)がまったく実行されていないようです。内部にアラートを配置してテストしましたが、実行されません。IEDeveloperにエラーは表示されません。
これが私のコードとサイトへのリンクです:http ://www.elke.co/testimonials/
<script type="text/javascript">
jQuery(function () {
var $container = jQuery('#sort');
$container.imagesLoaded(function () {
$container.masonry({
itemSelector: '.box',
columnWidth: 100
});
});
$container.infinitescroll({
navSelector: '.navigation', // selector for the paged navigation
nextSelector: '.navigation .nav-previous 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://www.elke.co/wp-content/themes/shaken-grid-free/images/ajax-loader.gif'
}
},
// trigger Masonry as a callback
function (newElements) {
// hide new items while they are loading
var $newElems = jQuery(newElements).css({
opacity: 0
});
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function () {
// show elems now they're ready
$newElems.animate({
opacity: 1
});
$container.masonry('appended', $newElems, true);
});
});
});
</script>