Skip to content

Instantly share code, notes, and snippets.

@davidsneal
Created July 1, 2015 16:16
Show Gist options
  • Save davidsneal/2ff58d4df8480ce18c5c to your computer and use it in GitHub Desktop.
Save davidsneal/2ff58d4df8480ce18c5c to your computer and use it in GitHub Desktop.

Revisions

  1. davidsneal created this gist Jul 1, 2015.
    19 changes: 19 additions & 0 deletions gistfile1.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    <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>