How To: Custom HTML / CSS Text Button for "Facebook like" & "Twitter Follow"

Posted by 1Line on Stack Overflow See other posts from Stack Overflow or by 1Line
Published on 2013-06-24T21:45:11Z Indexed on 2013/06/24 22:21 UTC
Read the original article Hit count: 122

Filed under:
|
|
|
|

So i have had a little hunt online about creating custom Facebook like buttons and custom twitter follow button but not really found a solution so thought i would ask here and see if anyone knows of a solution for this (currently i have coded some jQuery to get Facebook and Twitter counts using JSON which works but want some custom buttons as per below)

Desired outcome from social buttons

I have the count working all ok, just need to tackle the like and follow buttons - it is done in jquery at the moment so would like to continue to use that if this has to be done via that.

at the moment i use the API for each to get the count, if i can integrate into the current js i have to get the calls / functions i require would be good:

// grab from facebook
    var facebook = $.getJSON('https://graph.facebook.com/'+f_page+'?callback=?', function(data) {
        fb_count = data['likes'].toString();
        fb_count_gt = data['likes'].toString();
        fb_count = add_commas(fb_count);
        $('#fb_count').html(fb_count);
    });

    // grab from twitter
    var twitter = $.getJSON("https://twitter.com/users/"+t_page+".json?callback=?",function(data) { 
        twit_count = data['followers_count'].toString();
        twit_count_gt = data['followers_count'].toString();
        twit_count = add_commas(twit_count);
        $('#twitter_count').html(twit_count);
    });

Thanks in advance!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html