Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
91
rated 0 times [  93] [ 2]  / answers: 1 / hits: 32183  / 14 Years ago, tue, january 4, 2011, 12:00:00

Is it possible to add a custom facebook like icon? I would like it to be part of an <ul> and I don't really want to load another library their SDK or all the <meta> tags....



Has anyone implemented a custom like button? I don't need the counter etc that their buttons provide, and to be honest, they are ugly. I have been searching around for the last 2 hours with no real luck.



I found this:



<a name=fb_share></a> 
<script src=http://static.ak.fbcdn.net/connect.php/js/FB.Share
type=text/javascript>
</script>


But it implements one of their buttons.



EDIT:



I have read their API, while very easy to use I don't like the buttons generated from their <iframe> or XFBML code. I am simply looking to find out if there is a way to make a custom link from something like this:



<ul>
<li><a href=some code here>Facebook</a></li>
</ul>


Am I missing something in their API? it always generates a HUGE button with a counter and their graphics, which is exactly what I don't want.





More From » facebook

 Answers
10

If you're not hand crafting it, there's the Facebook developer Like API documentation



If their API doesn't expose what the generated buttons do for you to copy, one way to find out what the like button is actually doing (if it's not a hyperlink, and since it might be posting by ajax, this could happen) is finding out how the event is handled in javascript. This may be problematic if the script has been optimised/minified.



Another approach is to find out what HTTP requests it generates, using Fiddler to listen to the request and inspect it to see its target and any form data.



If you're happy with the functionality of the like button, but not its style, restyle it with CSS, this may be the safer option, as any API change may break any mimicked script.



Otherwise, unless you're designing your own icons, you can download the free silk icons, use the thumb up icon as an image, and slightly edit it for any mouse-over/click events that require different icons, and you can handle the events with JavaScript, JQuery or JQuery-UI (depending on which libraries you've already got loaded).



That should deal with the UI behaviour, any calls back to the server could be made with AJAX (JQuery AJAX documentation).


[#94381] Sunday, January 2, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kristinsonjab

Total Points: 364
Total Questions: 98
Total Answers: 98

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
kristinsonjab questions
Fri, Mar 4, 22, 00:00, 2 Years ago
Fri, Jan 22, 21, 00:00, 3 Years ago
Fri, Aug 14, 20, 00:00, 4 Years ago
;