Facebook like button display under content- squarespace - facebook

Im trying to add a facebook like button to my website, however when you click the like button, the share bubble appears under the content.
Im using facebook´s HTML5 button on squarespace
You can see the problem here, at the bottom of the page
http://mindarin.com/
The share bubble appears under the logo, it happens everywhere though, if I place the button where I want to ( top of page ) the bubble appears behind the main image.
Thanks!

You can hide the share tooltip by adding overflow:hidden;height: 21px; to fb-like widget css.
<div style="overflow:hidden;height: 21px;" class="fb-like" [...] />

Related

Make the Facebook like button comment popup anchored on right with box count layout

I'm trying to properly align the Facebook like button's comment popup. I'm using box count layout so that I can align all the Facebook/Twitter/Google+/Whatever buttons on the right side.
Here is my actual page layout. It looks like I want.
But once I click the Like button, the comment popup appears anchored from the left and is out of the window. Bummer.
What I want is simply have the popup anchored from the right instead of the left
I tried all versions of the button. IFRAME version does not show the comment box but can't be properly aligned. HTML5 and XFBML are properly aligned but they both show the popup out of the window.
I don't see any parameter in Facebook's documentation to adjust the alignment of the comment popup or to force the comment popup to be opened in a real browser popup. BTW, this can't be adjusted by CSS since the damn popup is inside a damn IFRAME, even when I'm using HTML5 and XFBML markup.
Is there a clean way to:
Anchor this popup to the right
Open the popup in an actual browser popup (window.open())
Hide the popup
Is there a way to achieve that? Google +1 button does the job perfectly without needing to add a lot of code.
Of course, the easy solution would be to move my buttons on the left side but it sucks.
Any help will be appreciated. Thanks :)
Try this
<center>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1">
</script><iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FID_HERE&layout=standard&show_faces=false&colorscheme=light&width=50&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:30px;" allowtransparency="false"></iframe>
Replace ID_HERE with your page id

Facebook Like and share Iframe are beneath the content

I have the following site, I just added the facebook like button, but after clicking on the like button, the iframe will appear beneath the content. I also added the google share and that is working fine. What can be the problem with the like/send buton?
Perhaps it is because in your CSS, you have overflow:hidden in your #maincolumn_middle. It will hide any elements within it, including the pop-up iframe window. Removing the overflow:hidden would show it.

How to trigger Facebook like button from custom button?

I have created a custom Facebook like button.
How do make it that when I click the button, it will trigger the like button provided by Facebook like the one below?
According to facebook policy on Social Plugins point 4 states:
"Don’t obscure or cover elements of social plugins."
You can't change the image directly because it's provided by Facebook.
The Facebook button is in an iFrame with a source that is on a different domain, Facebook’s domain, and so you can't change the button as it's protected by the same-origin policy.
Also, Facebook’s policy prohibits changing their buttons and logos when using embedded content from Facebook, like social buttons.
So, you're not suppose to be able to change the FB buttons, and even if you could it would be against the Facebook Terms of Service.
But... if you still want to do it, you can use the native Facebook button and lay your own image on top or below the Facebook button to fake a custom button.
Laying your image on top is only possible if you use CSS3 pointer-events, wich will make your image click-through and the click event will work "through" your image and actually click the Facebook button.
This only works in newer browsers that support Pointer Events.
Another option is to lay the image behind the FB button and set the FB button's opacity to zero.
I have used this several times myself, and with a little digging around in the Facebook code you can attach hover events and everything else to make it look like a custom button. You would have to find what elements to set opacity : 0 on.
Have never spent any time trying to figure out how to make the unlike function of the original button work on a custom button, but it's probably possible.
All my attempts to actually trigger the FB button with javascript or jQuery trigger() have failed, but maybe someone else has figured out how to do it?
When you create a html element with fb-like class, facebook javascript SDK convert it with a like button when document loaded. You can make a custom element and trigger click event of like button when user click your custom button.
For example :
<input type="button" id="mycustombutton" value="Like">
<div style="display:none" class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
jQuery code:
$("#mycustombutton").click(function(){
$(".fb-like").find("a.connect_widget_like_button").click();
// You can look elements in facebook like button with firebug or developer tools.
});
Update
Facebook SDK has been creating like button in an iframe and browsers not allowing to intervention to the iframe in the page. I think add event listener to element in iframe does not possible anymore.
This is not allowed for the obvious reason that it would lead to fraud. Imagine if each time you clicked an image on the web you don't know if it's an actual image or if it will result in a like and show up in your FB feed. It would be disastrous.
If you do want to do this legitimately, you will need to create an app and have the user authorise the app when he visits your site. This will open a popup where the user agreed to let the app access his FB account. Once that is done you can then send the like request on behalf of the user via a server-side script. In other words, it's not worth the effort.
If on the other hand you just want to get the like count for a page and display it however you want, you can do so via a request to "http://graph.facebook.com/#{url}" which will return a JSON payload with the number of likes. In jQuery it would be:
$.getJSON("http://graph.facebook.com/#{url}", function(data) { alert(data.shares); });
I think that facebook goes through great lengths to make sure people can't trigger the "Like" button. This is to prevent scripts from automatically clicking the "Like" button when someone visits the site.
You may be able to override the style of it using CSS and have your image show instead.
You can overlay your button on top of the Facebook like button and use css to hide the Facebook button.
Not sure on the legalities of this however.
You could try to trigger an Ajax request like this
FB.api(
'me/og.likes',
'post',
{
object: "http://samples.ogp.me/226075010839791"
},
function(response) {
// handle the response
}
);
https://developers.facebook.com/docs/reference/opengraph/action-type/og.likes
http://sharingbuttons.io/ allows to make social media share buttons with no javascript at all (Not a like button like in the question…). For Facebook, it just uses a link like this:
<a href="https://facebook.com/sharer/sharer.php?u=http%3A%2F%2Fsharingbuttons.io"
target="_blank" aria-label="Share on Facebook">Share on Facebook </a><br>Here on Stackoverflow, you have to cmd + click to open the link in a new window.
Customize it with your own CSS and, to mimic the share button, just open the url in a popup instead of a target="_blank".

Like / Send popup "flyout" hidden in FB tab

I'm trying to implement a send button on my custom FB tab app.
Using the XFBML share button works, but when you click on it, the pop-up (aka "flyout") gets hidden due to the overflow: hidden; css.
Changing the overflow attribute to visible, for example, doesn't have a effect (probably cause I'm telling FB to resize the tab:
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.Canvas.setSize();
}
</script>
Screenshot of the problem:
http://i.stack.imgur.com/sHH1a.png (I'm a new user, not allowed inline images)
Is there a way of telling the box to display on top of the right FB sidebar or on the left of the button instead of the right?
Do I need to create a dialogue box with share & like buttons? (this might become problematic as I intend to display a send button next to each row).
Link to raw tab index.php : http://openair.co.nz/facebook/events/
You may consider positioning the Send button to the left side of the tab iframe, and make sure that the bottom send button has enough space below itself to open a popup without losing it again. No other known solutions (my opinion)

Placing the like button of a fan page in the middle of a landing page

I wanted to know if it is possible to add the like button of a Facebook fan page(which is normally placed on the header of the page), as being embedded inside a landing page. I know I can make use of the like button generator given by Facebook http://developers.facebook.com/docs/reference/plugins/like/ , but I am after getting the like button of a fan page (which in reality is visually different than the like button that is generated at the above mentioned link). If indeed there is a way , please let me know. I welcome your suggestions.
Regards,
Ghulam Mustafa Majal
You can place a like button to the Facebook Page inside the landing page by specifying the appropriate href or using the Like box (https://developers.facebook.com/docs/reference/plugins/like-box/). For example, this Like button likes the Facebook Platform Page and can be pasted directly inside an iframe on a Page Tab:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=191014414294211&xfbml=1"></script><fb:like href="http://www.facebook.com/platform" send="true" width="450" show_faces="true" font=""></fb:like>