开发者

CakePHP Facebook plugin: custom login button image

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜