Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Google plus share in popup like Twitter?

The Google+ icon automatically shares the page on HOVER, and doesn't require a click like the others. Is there anything that can be done about this, to require a click like the others [fb,twitter] and to load in a popup as happens with the Twitter share icons?

like image 813
Miuranga Avatar asked May 10 '12 10:05

Miuranga


1 Answers

The JavaScript window.open method will open a new window. You can combine this technique with the share link to accomplish your goal. Here's an example of this technique lifted from the official docs. Just substitute your target url for http://example.com.

<a href="https://plus.google.com/share?url=http://example.com"
  onclick="javascript:window.open('http://example.com','',
  'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');
  return false;">
  <img src="https://www.gstatic.com/images/icons/gplus-64.png" 
    alt="Share on Google+"/>
</a>
like image 165
mimming Avatar answered Sep 24 '22 05:09

mimming