Responsive Facebook Comments CSS Hack Broken

后端 未结 17 1755
渐次进展
渐次进展 2020-12-12 22:48

I was using:

.fb-comments, .fb-comments span, .fb-comments iframe[style] {
    width: 100% !important;
}

To make Facebook Comments responsi

17条回答
  •  萌比男神i
    2020-12-12 23:34

    Ok this is what I have so far based one Timothy's comment.

    function resizeFbComment(){
    
      if (typeof FB === 'undefined')
        return;
    
      $(".fb-comments").attr("data-width", $(".fb-comments").width());
    
      FB.XFBML.parse($(".comments")[0]);
    
    }
    
    $(window)
      .load(resizeFbComment)
      .resize(resizeFbComment);
    

    Obviously, this is a temporary hack. The windows resize should have a timeout.

提交回复
热议问题