1.offsetは、のみ割り当てることはできません得ることができます
(1)要素.offsetParent //は、最も近い親要素の現在位置を返します
console.log(son.offsetParent)
(2)元素.offsetLeft //はリターンの左オフセットoffsetParentの
console.log(son.offsetLeft)
(3)の要素のオフセットoffsetParentのを返す// .offsetTop
console.log(son.offsetTop)
(4)要素.offsetWidth //は、現在の要素の内容+パディング+境界線の幅を返します。
console.log(son.offsetWidth)
(5)小学校.offsetHeight //現在の要素の高いコンテンツ+パディング+枠線を返します。
console.log(son.offsetHeight)
2.clientしか割り当てを取得することはできません
(1)元素コンテンツ要素.clientWidth //広い可視領域+パディング
console.log(' clientWidth ' + son.clientWidth)
高いコンテンツ(2)の要素.clientHeight // +パディング要素可視領域
console.log(' clientHeight ' + son.clientHeight)
(3)要素は、//左の境界の要素の値を.clientLeft
(4)要素.clientTop //要素の境界線の値を
VaRのボックス=のdocument.getElementById(' ボックス' ) はconsole.log(box.clientLeft) はconsole.log(box.clientTop)
3.scroll
(1)要素内容の素子幅を.scrollWidth
console.log(son.scrollWidth)
要素(2)エレメントの.ScrollHeight高含量
console.log(son.scrollHeight)
(3)転動体コンテンツ要素の左側から.scrollLeft 単位を記述する必要を割り当てることができません
(4)上部から転動体.scrollTop元素の含有量は、 単位を書き込む必要が割り当てられることができません
father.onscroll = 関数(){
にconsole.log(father.scrollLeft)
にconsole.log(father.scrollTop)
}
4. window.innerWidth、window.innerHeightブラウザ広い可視領域を割り当て可能、高くないを得ることができます
console.log(window.innerWidth)
はconsole.log(window.innerHeight)
5.window.pageXOffset、window.pageYOffsetブラウザ全体左ページの側との距離のうちスクロールのトップ
window.onscroll = 関数(){
にconsole.log(window.pageXOffset)
にconsole.log(window.pageYOffset)
}