- Added visible continents to options
This commit is contained in:
@@ -44,6 +44,22 @@ export function throttle (fn, delay) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Get a DOM element's position
|
||||
*/
|
||||
export const getPosition = (node, scope) => {
|
||||
const root = scope || document
|
||||
let offsetTop = node.offsetTop
|
||||
let offsetLeft = node.offsetLeft
|
||||
while (node && node.offsetParent && node.offsetParent != document && node !== root && root !== node.offsetParent) {
|
||||
offsetTop += node.offsetParent.offsetTop
|
||||
offsetLeft += node.offsetParent.offsetLeft
|
||||
node = node.offsetParent
|
||||
}
|
||||
return { top: offsetTop, left: offsetLeft }
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Wrap string's each letters into a span
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user