Facebook Like Widget on Fan page, Comment area out of visible area

12.5k views Asked by At

When using the like or send widget on a Fan Page (no mater if you use iframe tag or fbml for it) the overlay for commenting is positioned always to the right. see http://twitpic.com/4q7ggi for example.

I cant find a way to get the widget to respect the 520px boundary of the facebook tab. see http://www.facebook.com/pages/Ludwig-Test/127771653944246?sk=app_101150316644842 for an example. Anyone an idea how to solve this ?

TIA Rufinus

5

There are 5 answers

3
seler On BEST ANSWER

Try adding this to your css:

.fb_edge_comment_widget {
    margin-left: -350px;
}

This will move comment box to the left, but the little arrow pointing to the button will move too (which you could try to cover with another element). It will only work if you're using XFBML, not an iframe.

Here's an example.

0
Marcel Kalveram On

I had to move the little arrow to the bottom, and that's how i did it.

1) Move your popup window to the desired position. Use the !important statement to overwrite default styles.

.fb_edge_comment_widget {
    top: -224px !important; left: -246px !important; height: 191px;
    background: url(../img/arrow-down.gif) 0 100% no-repeat
}

This style also contains a new arrow image which replaces the bottom line of the popup window. It contains my own new bottom arrow, which is blue (#283E6C) by default and grey inside (#F2F2F2). We can use height to adjust the vertical position and move the background image to the bottom.

The image will look like this: Image overlay for facebook like button popup.

2) Apply overflow: hidden to the span that wraps the iframe, We'll be able to cut off parts of the iframe by applying margin-top in step 3, and replace them with our own.

.fb_edge_comment_widget > span {
    height: 184px !important; overflow: hidden; border-top: 1px solid #000;
}

I'm using border-top to create my own upper border, since in step 3 we are cutting of the default border and arrow.

3) Move the iframe up a bit to cut off its upper border and arrow.

    .fb_edge_comment_widget > span > iframe {
        margin-top: -7px;
    }   

The result looks like this in my case:

enter image description here

0
John On

To fix it I strongly recommend to put the Facebook widget on the left side of your page. Any other solution could work for a certain period of time, but in the future will fail. The reason is that Facebook updates its widget frequently.

1
rjb On

If you're using the XFBML implementation of the Facebook Like button, you can use CSS to re-position the "flyout" menu relative to its original position near the Send button:

enter image description here

The above example using jsFiddle and this CSS:

.fb_edge_comment_widget {
    margin-left: -343px;
}

Since the contents of the "flyout" are inside an iframe you won't be able to apply any CSS to it — meaning, moving the triangle indicator to the right side of the "flyout" isn't possible.

Web browsers have tightened security on cross-frame scripting due to spoofing and other hacks, so iframes are treated like separate HTML pages with their own CSS and JavaScript.

For any advanced CSS styling, you would have to inject the Facebook Widget's iframe using DOM Scripting ... and even then it may not work across browsers.

0
Alex On

Not a great answer but the only option I have found is to wrap the widget in an absolutely positioned Div to keep it on the left side of the window