Skip to content

Instantly share code, notes, and snippets.

@hopeseekr
Created January 18, 2018 17:46
Show Gist options
  • Save hopeseekr/5bf0af90827a27687264d6f1c23f2fed to your computer and use it in GitHub Desktop.
Save hopeseekr/5bf0af90827a27687264d6f1c23f2fed to your computer and use it in GitHub Desktop.
// Ensure that the interstitial is properly centered.
var $centerDialog = function($dialog) {
var marginTop = ($dialog.height() + ($($window).height() / 2)) * -1;
var marginLeft = ($dialog.width() + ($($window).width() / 2)) * -1;
$dialog.css({
top: '50%',
left: '50%',
margin: marginTop+'px 0 0 -' + marginLeft+'px'
});
};
$centerDialog($cryptoDialog);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment