0
目前正在構建一個使用來自Desandro的jQuery Masonry的站點,其中內置了Infinite Scroll。除了IE之外,每個瀏覽器都能很好地工作(即使IE7和IE8也能正常工作)。看來,jQuery(函數)根本沒有執行。我已經通過放置警報進行測試,但從未執行。 IE Developer中沒有顯示錯誤。在IE9中不執行jQuery函數
這裏是我的代碼,並在網站的鏈接: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>
我認爲你是正確的。它與IE9中的安全設置有關。 – plumwd