Google+ 图标会自动在 HOVER 上共享页面,并且不需要像其他图标一样点击。有什么办法可以解决这个问题,需要像其他人 [fb,twitter] 一样点击并像 Twitter 共享图标一样加载弹出窗口?
最佳答案
JavaScript window.open
方法将打开一个新窗口。您可以将此技术与 share link 结合使用。来完成你的目标。这是从 official docs 中提取的此技术的示例。 .只需将您的目标网址替换为 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>
关于google-plus - 如何在 Twitter 等弹出窗口中获得 Google plus 共享?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10532574/