Move / Position Facebook Like Button Comment Popup
Asked Answered
R

4

20

I need to move the popup comment box associated with a facebook like button. I understand this question has been asked and resolved a myriad of times.

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

Screenshot of same issue as mine: http://twitpic.com/4q7ggi

The difference here is that I believe Facebook has changed the implementation within the past several months so that both the Like Button and the comment popup are contained within a single iframe. I would expect they likely did this because it would be the only reliable way to guard against malicious websites taking advantage of users by auto-liking content. However, it means that I can't apply CSS to reposition the comment box.

I am using the HTML5 like button implementation, which is the same used on the official facebook reference for like buttons http://developers.facebook.com/docs/reference/plugins/like/. To see an example, click the like button on the facebook reference page again and then inspect the comment popup element. You'll see that both the like button and comment popup are contained within the same iframe.

Robrobaina answered 6/11, 2012 at 17:54 Comment(1)
Hey, I have the same issue to.. Did you manage to resolve this ?Woodruff
S
4

This has worked for me in the past.

.fb-like.fb_edge_widget_with_comment.fb_iframe_widget span iframe {
    /* Now you can apply css here */
    bottom:0!important;
}
Silkstocking answered 15/3, 2013 at 17:3 Comment(0)
L
2

You can't change the CSS of the comment box inside the iframe because it's an violation of the same origin policy:

The policy permits scripts running on pages originating from the same site to access each other's methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites.

The send message to box can be changed with CSS because it doesn't reside in the iframe.

Lambaste answered 27/2, 2013 at 0:40 Comment(0)
S
1

this works for me, here is a fiddle example. All I do was a simple modification with css:

.fb_edge_widget_with_comment span.fb_send_button_form_widget {
  top:100px!important;  /*for example*/
  left:100px!important;        /*for example*/
}

​ hope this helps.

Succentor answered 19/12, 2012 at 11:57 Comment(2)
I don't notice this moving the comment box at all.Patrinapatriot
i think its a like honey pot :) - original one i must sayCommons
F
0

I checked out the Facebook example and I am seeing this comment box: http://screencast.com/t/fRQyUzqek

I inspected, and applied stylings to this class:

.-cx-PRIVATE-pluginCommentFlyout__full {
    top: 100px!important;
    left: 100px!important;
}

And that moved the comment box. However, I did this directly in the inspector, so when you are using it in your CSS, you may need to include the parent selectors as well to be really specific.

Hope this helps!

Fairhaired answered 23/1, 2013 at 20:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.