Skip to content

Instantly share code, notes, and snippets.

@reubenmoes
Created May 1, 2015 17:14
Show Gist options
  • Save reubenmoes/5df1233beb0d194e8fbc to your computer and use it in GitHub Desktop.
Save reubenmoes/5df1233beb0d194e8fbc to your computer and use it in GitHub Desktop.
socialShare.js
vec.socialShare = {
selector: '.js-share_link',
init: function() {
$(vec.socialShare.selector).click(function(event){
event.preventDefault();
var href = $(event.target).attr('href'),
left = (screen.width/2)-(550/2),
top = (screen.height/2)-(300/2);
window.open(href, 'Share', "height=300,width=550,resizable=1, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no,top="+top+", left="+left);
});
} // init
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment