Facebook Share Popup

Facebook share popup JS function.

by Julia Will

HTML

<script>
    function fbShare(url, winWidth, winHeight) {
        var winTop = (screen.height / 2) - (winHeight / 2);
        var winLeft = (screen.width / 2) - (winWidth / 2);
        window.open('http://www.facebook.com/sharer.php?s=100&&p[url]=' + url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
    }
</script>
<a href="javascript:fbShare('https://collicare-xpprod.enonic.cloud/admin/site/preview/corporate-no/draft/collicare', 520, 350)">Share</a>