我有一个脚本可以在加载其中的图像后加载元素。我想先加载元素然后再加载图像。有人能帮我吗?
脚本:
jQuery.ias({
container : '#con',
item: '.bo',
pagination: '.pages',
next: '.next',
loader: '<img src="loader.gif">',
onLoadItems: function(items) {
// hide new items while they are loading
var $newElems = $(items).show().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 });
$('#con').masonry( 'appended', $newElems, true );
});
return true;
}
});