石積み#boxes
を使用してから適用するために、空にしてコンテンツを追加する必要があるコンテナがあります。.imagesLoaded()
デフォルトでは、コンテンツには石積みのアイテムが含まれていますが、これを削除してから、応答に含まれる新しいアイテムを追加しています。私のコードの問題は、私が信じている追加の後にコンテンツを空にしていることです。何か案は?
$(document).ready(function($){
$('div.profile-archive').click(function(){
$("#boxes").empty();
$this = $(this);
var postType = $this.attr("rel");
data = {
action: 'fetch_profile_archive',
postType : postType
};
$.post(ajaxurl, data, function (response) {
var $response = $(response);
$response.imagesLoaded(function() {
$("#boxes").masonry('reload');
}).appendTo("#boxes");
});
});
});