Is it possible to set a fluid width for Facebook's social plugins?

后端 未结 29 1470
粉色の甜心
粉色の甜心 2020-12-22 18:52

I\'m developing a site around the \"responsive design\" concept, but the facebook social plugins are static width and \"break\" the layout when it\'s re-sized.

Using

29条回答
  •  不思量自难忘°
    2020-12-22 19:18

    Here's a small work around that appends the HTML5 Facebook LikeBox Plugin into the DOM with a response height or width.

            $(document).ready(function(){      
                var height = $(window).height();
                var width = $(window).width();
    
                var widget_height = parseInt((height)*0.9);
                var widget_width = parseInt((height)*0.3);
                var page_url = "http://www.facebook.com/Facebook";
    
                $(".fb-plugin").append("
    "); });

提交回复
热议问题