当我的页面第一次加载时,砌体重叠图像,如果我刷新页面,它开始工作正常。我不知道我做错了什么。我的页面链接是这个 www.bhinderblink.com
<script type="text/javascript">
$(window).load(function () {
$('#container').masonry({
// options
itemSelector: '.box',
columnWidth: 240,
isAnimated: true,
isFitWidth: true,
animationOptions: {
duration: 650,
easing: 'linear',
queue: false
}
});
});
</script>
在 .ajax 成功时,它从 xmlobject 获取数据...
function OnSuccess(response) {
var xmlDoc = $.parseXML(response.d);
var xml = $(xmlDoc);
pageCount = parseInt(xml.find("PageCount").eq(0).find("PageCount").text());
var pic_infoVar = xml.find("pic_info");
pic_infoVar.each(function () {
var customer = $(this);
//...........
var $picString = $("<div class='box'><img id='theImg' src='/pic/jas/" + customer.find("pic_name").text() + ".jpg" + "'/><div>Detail2</div></div>");
$("#container").append($picString).masonry('appended', $picString, true);
});
$("#imgloader").hide();
$("body").css({ "opacity": "100" });
}