I want to display LinkedIn popup in a small new window, but the share popup keeps opening as a new full screen tab.
This is the piece of HTML I'm using:
<div class="share-block">
<a
href="#"
onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(document.URL) + '&title=Excellent review on my website reviews', '_blank, width=500, height=500, resizable=yes, scrollbars=yes'); return false;"
><i class="fa fa-fw fa-linkedin"></i> LinkedIn</a>
</div>
I'm using the same code for Facebook and Twitter which opens up the popup in a new small window as it should. This is the Twitter HTML for example:
<div class="share-block">
<a
href="#"
onclick="window.open('https://twitter.com/intent/tweet?text=Excellent review on my website:%20' + encodeURIComponent(document.URL), '', '_blank, width=500, height=500, resizable=yes, scrollbars=yes'); return false;"
><i class="fa fa-fw fa-twitter"></i> Twitter</a>
</div>
I can't figure out why doesn't it work with LinkedIn. This is what I want to achieve
How to display LinkedIn share in new window like shown on the image?
The second argument in the window.open
is for title
. You missed that in your linked in popup. So that it treat as all the _blank, width=500.....
everything as title. That is the reason it is not following any property width
and height
and etc. Add that empty string as the second parameter ''
.
Fiddle DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With