Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook共享按钮-自定义图像_Facebook_Facebook Graph Api_Share - Fatal编程技术网

Facebook共享按钮-自定义图像

Facebook共享按钮-自定义图像,facebook,facebook-graph-api,share,Facebook,Facebook Graph Api,Share,我正在尝试将facebook的共享按钮集成到我的页面中。我正在使用以下代码: <a name="fb_share"></a> <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"> </script> <a name="fb_share"><img src="fb.png" />&l

我正在尝试将facebook的共享按钮集成到我的页面中。我正在使用以下代码:

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

这将生成用于共享的图像和代码。然而,我正在尝试使用我自己的图像作为共享按钮。我正在使用以下代码:

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

其中fb.png是带有fb徽标的自定义图像

问题是我的图片和通用的Facebook共享图片一起显示在左边。。。你知道有没有办法实现共享按钮的自定义图像


提前谢谢

你应该这样做:

HTML

<a id='share'><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" 
    type="text/javascript"></script></a>
#share *{
   filter:alpha(opacity=0.1); 
   opacity:0.01;/*Hide Facebook button*/
}

#share{
  display:inline-block;

  /*The width and height of your image. Not bigger than the Like button!*/
  width: 10px;
  height: 10px;

  /*Your image*/
  background:url(fb.png);
}

你应该这样做:

HTML

<a id='share'><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" 
    type="text/javascript"></script></a>
#share *{
   filter:alpha(opacity=0.1); 
   opacity:0.01;/*Hide Facebook button*/
}

#share{
  display:inline-block;

  /*The width and height of your image. Not bigger than the Like button!*/
  width: 10px;
  height: 10px;

  /*Your image*/
  background:url(fb.png);
}

我认为FaceBook禁止编辑it按钮。我也想做同样的事情,但放弃了……我认为FaceBook禁止编辑它的按钮。我想做同样的事情,并放弃了…是不是“不比like按钮大”,因为设置了可点击元素的宽度/高度?你能用JQuery覆盖它吗?@Pro83:那是因为
Like
按钮有固定的高度和宽度;如果图像大于该值,则位于
Like
按钮之外的图像部分不会触发Like。如有必要,您可以将多个按钮直接放置在彼此的旁边和下方,以覆盖整个图像。是否因为设置了可单击元素的宽度/高度而“不大于类似按钮”?你能用JQuery覆盖它吗?@Pro83:那是因为
Like
按钮有固定的高度和宽度;如果图像大于该值,则位于
Like
按钮之外的图像部分不会触发Like。如有必要,可以将多个按钮直接放置在彼此相邻和下方,以覆盖整个图像。