Because these buttons include the HTML structure on your page, they are styled using CSS. This way you can move pop-up dialogs using CSS.
Some code
If you take a closer look at the pop-ups presented by facebook, you will see that some styles are attached to them:
The only thing you need to do now is move this popup using CSS to the correct position.
For example: if you want to completely hide the comment popup of a similar button, you can simply use this CSS:
.fb_edge_comment_widget.fb_iframe_widget { display: none; }
If you want to move it, you cannot use .fb_edge_comment_widget.fb_iframe_widget
, since the element properties (set by JavaScript) override your CSS. You should use span one element below:
.fb_edge_comment_widget.fb_iframe_widget > span{ right: 300px; }
This code will move the popup window 300 pixels to the left:
This is not the prettiest solution (note that the small arrow at the top of the window now indicates nothing), but it works.
Full test code:
<!DOCTYPE html> <html> <head> <title>Test</title> <style type="text/css"> .fb_edge_comment_widget.fb_iframe_widget > span{ right: 300px; } #wrap { width: 650px; margin: 0 auto; } </style> </head> <body> <div id="wrap"> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=336384849737745"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like" data-href="http://www.google.de" data-send="true" data-width="500" data-show-faces="false"></div> </div> </body> </html>
apfelbox
source share