이 문제에 대해 10 시간을 보냈지 만 해결할 수 없습니다. 나는 disqus 코멘트와 함께 부트 스트랩 3을 사용하고 있습니다. 어떻게 든 disqus 코멘트가 내 꼬리말을 겹치고 있습니다. 다음 그림을 참조하십시오.Disqus 주석이 내 바닥 글과 겹치고 있습니다.
나는 많은 트릭을 시도했지만 그들 중 누구도 일했다. JS를 사용하여
변경된은 iframe 크기를하지만 그렇지 않은 :
여기.wrapper { width:100%; min-height: 100%; height: auto !important; height: 100%; } .sections { width: 100%; padding-top: 20px; border-bottom: #d8d8d8 solid 1px; height: auto !important; } #comments { width: 100%; min-height: 350px; height: auto !important; }
내가 지금까지 한 일이다
<div class="wrapper"> <div class="sections"> <div class="row"> .... truncated unnecessary code <div id="comments"> <div id="disqus_thread"></div> </div> </div> </div> </div> <footer> ..... </footer>
CSS : 다음
는내 HTML 코드 직장
s etInterval (함수() {
$('#comments').css({ 'height': $('#disqus_thread').height() + 'px' }); }, 1000);
가 ~ 400 disqus_thread 높이를 변경하지만 새로운 코멘트
가 이 하나가사용 Disqus에 onReady은 iframe의 높이를 변경하는 이벤트에 불과하다
게시 된 높이를 변경하지 않습니다 또한 작동하지 않습니다. 아마도 onReady 이벤트를 호출 한 후 disqus 주석이로드되고 있습니까?
JS 코드
this.callbacks.onReady = [function() {
resizeIframeWidth($('#disqus_thread iframe'));
}];
function resizeIframeWidth(e){
// Set width of iframe according to its content
if (e.Document && e.Document.body.scrollWidth) //ie5+ syntax
e.width = e.contentWindow.document.body.scrollWidth;
else if (e.contentDocument && e.contentDocument.body.scrollWidth) //ns6+ & opera syntax
e.width = e.contentDocument.body.scrollWidth + 35;
else (e.contentDocument && e.contentDocument.body.offsetWidth) //standards compliant syntax – ie8
e.width = e.contentDocument.body.offsetWidth + 35;
}
같이로드 이벤트를 처리 할 수 있습니다 : 자동;''#의 comments'에 대한 규칙은 그것을 해결하는 것입니다. –
@TiesonT. 그것은 작동하지 않았다. 빈 공백이 많이 생겼고 disqus 주석도 사라졌습니다. 방금이 문제를 해결했습니다. 내 대답을 보라. 당신의 도움을 주셔서 감사합니다. – Maximus