1

我正在制作一个带有Simple Icons的自定义 Pinterest Pin It 按钮,并且我正在使用 Pinterest Widget Builder 给我的链接。在默认的 Pin It 按钮上,它会在一个全新的窗口中打开此链接。我看过很多 SO 问题,但所有这些都在新选项卡中打开它。

我需要在新窗口中打开此链接,而不是选项卡

HTML:

<div class="pinit" onclick='window.open("http://www.pinterest.com/pin/create/button/?url=http%3A%2F%2Flocalhost%3A8080%2FHowl%2FHome.html&media=http%3A%2F%2Fi.imgur.com%2FToZz7PB.png&description=Howl%3A%20Share%20Your%20Life")'><img src="http://raw.github.com/danleech/simpleicons/master/icons/pinterest/pinterest-64.png"></div>

CSS:

.pinit {
  background: #CB2027;
  width: 65px;
  border-radius: 10px;
  cursor: pointer;
}
.pinit:hover {
  background: #e41f11
}

JavaScript:

对于 JS,我使用了 Pinterest 链接:<script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js"></script>

4

1 回答 1

3

试试这个

<div class="pinit" onclick='window.open("http://www.pinterest.com/pin/create/button/?url=http%3A%2F%2Flocalhost%3A8080%2FHowl%2FHome.html&media=http%3A%2F%2Fi.imgur.com%2FToZz7PB.png&description=Howl%3A%20Share%20Your%20Life","Pin It","width=300,height=300,top=0,left100")'>

为您的新窗口提供名称和属性。

,"Pin It","width=300,height=300,top=0,left100"
于 2013-12-10T02:02:05.117 回答