编程语言/getBoundingClientRect:修订间差异
来自康健生活
| 第75行: | 第75行: | ||
// 这行代码放在此处,会丢失 margin-top | // 这行代码放在此处,会丢失 margin-top | ||
// root.current.style.position = container === document.body ? 'fixed' : 'absolute'; | // root.current.style.position = container === document.body ? 'fixed' : 'absolute'; | ||
console.log('rootRefWidth',rootRefWidth) | |||
console.log('rootRefHeight',rootRefHeight) | |||
root.current.style.top = offsetTop + 'px'; | root.current.style.top = offsetTop + 'px'; | ||
root.current.style.left = offsetLeft + 'px'; | root.current.style.left = offsetLeft + 'px'; | ||