Processing
 

Getting the height of a 'Facebook Comments' widget/social plugin

13/03/2012 19:44#1

Yuval A.

Member

Joined at: 11 months ago

Post: 12

Thank: 0

Thanked: 0

Using Facebook Javascript SDK+XFBML, I'm implementing the fb 'comments widget', as explained here.

then, using the fbml line:

<fb:comments href="someurl.com" num_posts="2" width="400"></fb:comments> 

creates an iframe with the comments widget.

The height of the iframe is of-course according to the length of the comments;
I need to make changes to my page according to the height of the comments widget.
I can tap into when the widget has finished loading, by using

FB.Event.subscribe('xfbml.render') 

(I found it more accurate than using 'ready' or 'load'), but I cannot get the height of the comments iframe due to cross-domain restrictions.

Does anybody know of some sort of a solution for this?

Thanks.

EDIT:
Workaround number 1: (from http://startdevelopment.blogspot.com/2011/03/issue-with-facebook-comments-box-height.html):

add a style to your page:

.fb_ltr { height: 400px !important; overflow-y: scroll !important; } 

'fb_ltr' is the class used by the iframe. This will make sure it's always 400px high, and add scroll-bar to scroll content.
Of-course, the scroll-bar is ugly, so, any other ideas?

25/10/2012 04:14Top#2

Joined at: 7 months ago

Post: 1

Thank: 0

Thanked: 0

I use the same idea as yours, modified the style, but it will use min-heigh Please try this,

.fb_ltr { min-height:100%; } 
14/07/2016 14:45Top#3

Joined at: 7 months ago

Post: 1

Thank: 0

Thanked: 0

First of all, thanks for you solution, Yuval A. Second, I found a clean and simple style for scroll bar here: CSS scrollbar style cross browser

In short is this code:

::-webkit-scrollbar {  width: 12px;  /* for vertical scrollbars */  height: 12px; /* for horizontal scrollbars */ } ::-webkit-scrollbar-track {   background: rgba(0, 0, 0, 0.1); } ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.5); }  
Similar articles

On click Facebook post link goes to another link

7 months ago - Reply: 0 - Views: 4

How to creat facebook note like this?

8 months ago - Reply: 4 - Views: 175

Other people logging into messenger

7 months ago - Reply: 2 - Views: 66

Can a fan page be changed back to personal profile

7 months ago - Reply: 2 - Views: 156

I'm getting problem to login my Facebook account

8 months ago - Reply: 8 - Views: 432

How can see All Facebook games?

7 months ago - Reply: 0 - Views: 2

Ads for Person Profile

7 months ago - Reply: 2 - Views: 132

Help me unlock ads account

5 months ago - Reply: 3 - Views: 140

How To Optimal Costs Running Facebook Ads (Part 1)?

7 months ago - Reply: 0 - Views: 1

Can you help me with facebook payment.

9 months ago - Reply: 4 - Views: 211

Facebook Targeted Ads

9 months ago - Reply: 2 - Views: 155

How to increase traffic using FB

7 months ago - Reply: 10 - Views: 582

how to get on-screen version of activity log

7 months ago - Reply: 0 - Views: 18

Facebook Bigpipe Technique Algorithm

5 years ago - Reply: 3 - Views: 260

Help about traffic by run FB ad!

7 months ago - Reply: 1 - Views: 12

Customers support on fb company page

8 months ago - Reply: 2 - Views: 94

My facebook fan pages are unpublished

8 months ago - Reply: 8 - Views: 379

Help me find target audience on facebook

5 months ago - Reply: 11 - Views: 336

Joining New Members to a Group

8 months ago - Reply: 3 - Views: 153

Changing webcam settings for Facebook Live?

9 months ago - Reply: 2 - Views: 135

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re