Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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