custom facebook like link?

前端 未结 4 910
误落风尘
误落风尘 2021-02-03 23:46

Is it possible to add a custom facebook like icon? I would like it to be part of an

    and I don\'t really want to load another library their SDK or all the
相关标签:
4条回答
  • 2021-02-04 00:21

    I found from another post here:

    <a title="send to Facebook" href="http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE&p[summary]=YOUR_SUMMARY&p[url]=YOUR_URL&p[images][0]=YOUR_IMAGE_TO_SHARE_OBJECT" target="_blank"><span><img width="14" height="14" src="'icons/fb.gif" alt="Facebook" /> Facebook></a>
    

    I used this and works well:)

    0 讨论(0)
  • 2021-02-04 00:22

    I found Chaddo's article on Custom Facebook Like Button (BlackHat Button) very effective using CSS to customize the button. You can download the zip source code. It works well, and could use improvement in regards to height.

    0 讨论(0)
  • 2021-02-04 00:42

    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).

    0 讨论(0)
  • 2021-02-04 00:46

    Customizing the Like button is against Facebook's policies.

    "While you may scale the size to suit your needs, you may not modify the Like Button in any other way (such as by changing the design)."

    0 讨论(0)
提交回复
热议问题