Twitter分享按钮将在完整窗口中打开

时间:2017-07-04 09:31:56

标签: jquery css

我有这段代码https://codepen.io/anon/pen/YQLdLg,我想给弹出共享窗口提供我想要的大小,更小,居中。现在它在一个完整的窗口中打开。

我尝试使用onclick="window.open(this.href,width=400,height=250);return false;但无法使其发挥作用。

1 个答案:

答案 0 :(得分:1)

  

演示: https://codepen.io/kumarrishikesh12/pen/VWxgbY

  

<强>实

<a href="https://www.facebook.com/sharer/sharer.php?u=http://www.example.com/" id="facebookurl" name="fb_url" target="_blank" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
  

<强> Linkdin

<a href="http://www.linkedin.com/shareArticle?mini=true&url=http://www.example.com/&title=myexample" id="linkedinurl" name="linkedin_url" target="_blank" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
  

<强>微博

<a href="https://twitter.com/intent/tweet?text=Check%20out%20my%20new%20webpage%21&via=example&url=http://www.example.com" id="twitternurl" name="twitter_url" target="_blank" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">

&#13;
&#13;
<p data-height="265" data-theme-id="0" data-slug-hash="VWxgbY" data-default-tab="js,result" data-user="kumarrishikesh12" data-embed-version="2" data-pen-title="Add share popup to links" class="codepen">See the Pen <a href="https://codepen.io/kumarrishikesh12/pen/VWxgbY/">Add share popup to links</a> by Rishikesh kumar (<a href="https://codepen.io/kumarrishikesh12">@kumarrishikesh12</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
&#13;
&#13;
&#13;