The default facebook button to like your facebook page is going to look pretty rubbish on my website so I wanted to create a custom designed button.
I have the code below trying to use jquery trigger to mimic the clicking of the facebook like button. I don't think this works though as the facebook like button is within an iFrame.
Can anyone see how this could work?
$(document).ready( function() {
$("a").live("click", function() {
$(".connect_widget_like_button").trigger('click');
return false;
});
});
And
<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/en_GB/all.js#xfbml=1&appId=164366676978480";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like-box" data-href="http://www.facebook.com/Google" data-width="292" data-show-faces="false" data-stream="false" data-header="false"></div>
<a href="#">test button</a>