knocked loose
knocked loose

Reputation: 3314

Custom social share not opening in windows?

I created a custom social sharing module based on this tutorial and am trying to understand why mine open up in a new tab at full screen, but the tutorial's opens up in new windows at certain sizes.

I would prefer mine to open up the same way this tutorial does, but I'm not sure. I know there is a way I can do this with JS where I define the size of the window, but that doesn't seem to be the most elegant solution to me.

Appreciate the help!

Here is the basic HTML of a link:

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

and here is my module's prototype.

Upvotes: 0

Views: 26

Answers (1)

Adam Buchanan Smith
Adam Buchanan Smith

Reputation: 9457

Just add the the size inside the window.open like this:

<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>

See fiddle: https://jsfiddle.net/1a8mpL75/1/

Upvotes: 2

Related Questions