Open Facebook's sharer.php similarly twitter intents popup
Make your facebook sharer.php social links open the same way as Twitter's intent links.
var socialpopup = function( url, title, width, height ) {
var top = ( screen.height / 2 ) - ( height / 2 );
var left = ( screen.width / 2 ) - ( width / 2 );
return window.open( url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left );
};
jQuery("a[href^='https://www.facebook.com/sharer/sharer.php']").click(function( event ) {
event.preventDefault();
var url = jQuery(this).attr("href");
socialpopup( url, "Share on Facebook", 550, 520 );
});Written by Kyle Hotchkiss
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#