How to open the link in new window of Google Plus Badge?

匆匆过客 提交于 2019-12-12 01:08:34

问题


I have in my website the code of Google Plus Badge and Google +1 Button
I need that the link to Google+ page (generate by Badge) open in new Window.

If you have other way, I need:

  • Link to Google+ Page.
  • Add function for add to circles.
  • +1 Button with the count.

All in a line.

My code look as:

<table>
<tr>
<td style="padding-top:2px; vertical-align:top;"><div style="width:180px; height:30px;     overflow:hidden;">
<div style="margin-top:-15px; margin-left:0px;" title="International Studies Google         Plus">
                <style type="text/css">
                             #___plusone_0, #___plusone_0         iframe{
                                 width:66px !important;
                             }
                            </style>
                <div class="g-plus" data-href="https://plus.google.com/118182458881247471225?rel=publisher" data-width="170" data-height="69" data-theme="light"></div>
              </div>
            </div></td>
              <td style="padding-top:6px; padding-left:5px;"><g:plusone></g:plusone>    </td>
</tr>
</table>

回答1:


You can't do this.

The badge does not provide any flag that allows you to open the link in a new window. It's also the only feature that provides the 'Add to circles' functionality that you require.

The closest that you can get would be to use a static badge and a +1 button:

<div>
  <a href="https://plus.google.com/118182458881247471225?prsrc=3" rel="publisher" style="text-decoration:none;" target="_blank">
  <img src="//ssl.gstatic.com/images/icons/gplus-32.png" alt="Google+" style="border:0;width:32px;height:32px;"/></a>

  <div class="g-plusone" data-annotation="inline" data-width="300"></div>
</div>

Also, it looks like there's a feature request for this functionality. If you star this feature request, you'll be notified about updates.



来源:https://stackoverflow.com/questions/11440498/how-to-open-the-link-in-new-window-of-google-plus-badge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!