2016-04-20 80 views
0

我创建了一个基于this tutorial的自定义社交分享模块,并且试图理解为什么我会在全屏幕中以新选项卡打开,但教程在特定大小的新窗口中打开。自定义社交分享不在Windows中打开?

我希望我的开放方式与本教程相同,但我不确定。我知道有一种方法,我可以通过JS来定义窗口的大小,但这似乎并不是我最优雅的解决方案。

感谢帮助!

这里是一个链接的基本HTML:

<a class="fa fa-twitter share-base share-twitter" onclick="window.open('https://twitter.com/intent/tweet?text=the text')"></a> 

,这里是我的module's prototype

+1

喜欢这张'的window.open( “”, “”,“宽度= 200,高度= 100 “);' –

+1

@AdamBuchananSmith漂亮,谢谢! –

回答

2

只需添加大小window.open内部这样的:

<a class="fa fa-twitter share-base share-twitter" onclick="window.open('https://twitter.com/intent/tweet?text=the text','','width=200,height=100')">test</a> 

参见拨弄:https://jsfiddle.net/1a8mpL75/1/