Is it possible to customize the Facebook button? [duplicate]

1

Can I create a custom facebook button? I want it when I click on my custom button ( link ) happen exactly the same as what would happen if I click the default button to enjoy from Facebook. If so, how can I do this?

    
asked by anonymous 02.06.2016 / 19:14

2 answers

2

Of course. You can for example arrange two images, with different backgrounds, and when you detect the click event you change the image. I think this will be the easiest approach, however there are other possibilities.

    
02.06.2016 / 19:25
1
<html> <head> </head> <body> <script> function toogleLikeIcon() { var sourceImage=document.getElementById("like").getAttribute("src"); switch(sourceImage) { case "notLike.png":document.getElementById("like").src="like.png";break; default:document.getElementById("like").src="notLike.png";break; } } </script> <img id="like" src="notLike.png" onclick="toogleLikeIcon();"> <body> </html>

link

 <script async src="//jsfiddle.net/1xo09yhc/embed/"></script>
    
02.06.2016 / 20:02