Skip to content

Instantly share code, notes, and snippets.

@davidsneal
Created July 1, 2015 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidsneal/2ff58d4df8480ce18c5c to your computer and use it in GitHub Desktop.
Save davidsneal/2ff58d4df8480ce18c5c to your computer and use it in GitHub Desktop.
HTML Share Buttons Popup
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
jQuery(document).ready(function($) {
jQuery('#share-buttons a').on('click', function(){
var width = 575,
height = 520,
left = (jQuery(window).width() - width) / 2,
top = (jQuery(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
newwindow=window.open($(this).attr('href'),'',opts);
if (window.focus) {newwindow.focus()}
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment