1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 06:44:35 +02:00

HTMLElement.offset* by getBoundingClientRect() (#21788)

* Replace element.offet* by getBoundingClientRect()

* Use variable to store BoundingClientRect

* Fix cc issue...
This commit is contained in:
Pierre Vanduynslager
2017-03-18 21:24:54 -04:00
committed by Mark Otto
parent f2f2e39a45
commit 275821bbb0
3 changed files with 12 additions and 11 deletions

View File

@@ -450,7 +450,7 @@ const Modal = (($) => {
const scrollDiv = document.createElement('div')
scrollDiv.className = ClassName.SCROLLBAR_MEASURER
document.body.appendChild(scrollDiv)
const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
document.body.removeChild(scrollDiv)
return scrollbarWidth
}