How to make facebook comment box width 100%?

前端 未结 9 564
逝去的感伤
逝去的感伤 2021-01-18 00:27

i am using this code to put a facebook comment box to my page,



        
9条回答
  •  感情败类
    2021-01-18 00:45

    well i think i managed to solve it, i analysed the comment box and saw that the fb-comments div is containing a span with the width of 470px by default, and inside this span i found an iframe of the same width, so the solution is to change the span and iframe width on window resize using jquery like this:

    $(window).resize(function(){$('.fb-comments iframe,.fb-comments span:first-child').css({'width':$('#commentboxcontainer').width()});});
    

    so now on window resize the whole comment box is taking the container width (by other means it is 100% width).

提交回复
热议问题