Facebook like box widget not recognizing data-width attribute?

后端 未结 9 2489
醉话见心
醉话见心 2021-02-19 07:26

I just noticed today that the data-width attribute for the Facebook Like Box widget does not appear to be working. It looks like it is reverting to the default width. An example

9条回答
  •  囚心锁ツ
    2021-02-19 08:23

    After the fb:like-box add this script change the 244px to your width

    FB.Event.subscribe('xfbml.render', function(response) {
    
     var el = document.querySelector(".fb_iframe_widget span");
     el.style.width='244px';
     el = document.querySelector(".fb_iframe_widget iframe");
     el.style.width='244px';
    });
    

提交回复
热议问题