Skip to content

Instantly share code, notes, and snippets.

@bilalucar
Created June 7, 2017 12:44
Show Gist options
  • Save bilalucar/e613899f20b6263b7dad5a39ccb88081 to your computer and use it in GitHub Desktop.
Save bilalucar/e613899f20b6263b7dad5a39ccb88081 to your computer and use it in GitHub Desktop.
Medium Menu -9
var rect = range.getBoundingClientRect();
var shareBox = document.querySelector('#shareBox');
shareBox.style.top = `calc(${rect.top}px - 38px)`;
shareBox.style.left = `calc(${rect.left}px + calc(${rect.width}px / 2) - 30px)`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment