I am trying to replace the default image with a custom one, but with no success. I have tried applying some CSS classes that put my image over Facebook's, but it gives me an error: truncated image
.
How c开发者_如何学Goan I replace the custom login button? I would appreciate if you can give me a 'caky' solution, as I use CakePHP Facebook Plugin for this. Thanks!
I the plugin's helper is simply wrapping the default button produced by fb:login-button. You will need to hook up the js manually if you want make it look different.
More info about FB.login() here, but for example, assuming you're using jQuery:
<a href='#' id='login' class='customLoginLink'>Login<a>
<script type='text/javascript'>
$('#login').click(function(event) {
FB.login(function(response) {
if (response.session) {
// user successfully logged in
} else {
// user cancelled login
}
});
});
</script>
Want it Cake-like? Wrap it in an element.
精彩评论