블로그 게시물을 표시하려면 내 사이트에서 jQuery Masonry를 사용하고 있습니다. 각 게시물 블록에는 Facebook 주석 상자가 추가되어 있습니다. 새로운 코멘트가있을 때 컨테이너 div가 확장되고 불행하게도 아래에있는 것과 중복됩니다. 이 경우 블록을 다시로드하기 위해 벽돌 스크립트를 다시 실행해야합니다. div 높이를 확인하여 div 블록을 재정렬하는 방법
은 그래서 벽돌 스크립트가 새로운 크기에 따라 블록을 재배치하고 중복을 피할 수 있도록 DIV의 높이의 변화를 확인하기 위해 Ben Alman's Jquery Resize Event Plugin을 사용하고 있습니다.
방화 광으로 점검 할 때 작동하지 않지만 오류가없는 것으로 보입니다. 저는 Jquery에 대한 초보자입니다. 나는 여기서 간단한 실수를하기를 희망합니다.
자세히보고 싶다면 bjk-tribun.com을 확인하십시오. 댓글 상자에 몇 개의 의견을 입력하면 중복되는 것을 볼 수 있습니다.
$(function(){
// Bind the resize event. When any test element's size changes, update its
// corresponding info div.
var iframe = $(".fb_iframe_widget");
// Called once the Iframe's content is loaded.
iframe.load(function(){
// The Iframe's child page BODY element.
var iframe_content = iframe.contents().find('body');
// Bind the resize event. When the iframe's size changes, update its height as
// well as the corresponding info div.
iframe_content.resize(function(){
var elem = $(this);
// Resize the IFrame.
iframe.css({ height: elem.outerHeight(true) });
$('#sort').masonry(reloadItems);
// Resize the Iframe and update the info div immediately.
iframe_content.resize();
});
});