03-offsetParent属性
2017-03-21 14:15
211 查看
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <div class="box1" style="position: absolute;"> <div class="box2" style="position: fixed;"> <div class="box3"></div> </div> </div> <script> //offsetParent:复习盒子中带有定位的盒子 //复习盒子中都没有定位,返回body //如果有,谁有返回最近哪个 var box3 = document.getElementsByClassName("box3")[0]; console.log(box3.offsetParent); </script> </body> </html>
相关文章推荐
- Javascript拖拽系列文章1之offsetParent属性第1/3页
- javascript中的offsetParent属性
- 关于JavaScript的OffsetParent属性
- JS OffsetParent属性深入解析
- js.offsetParent属性
- js.offsetParent属性
- JS OffsetParent属性深入解析
- js.offsetParent属性
- 【转】Javascript拖拽&拖放系列文章1之offsetParent属性
- Javascript拖拽&拖放系列文章1之offsetParent属性
- js.offsetParent属性
- offsetParent属性返回一个对象的引用
- JS OffsetParent属性深入解析
- JS OffsetParent属性深入解析
- JS OffsetParent属性
- Javascript拖拽&拖放系列文章1之offsetParent属性
- JS OffsetParent属性
- Javascript拖拽系列文章1之offsetParent属性第1/3页
- 元素的offsetParent offsetLeft offsetTop属性
- JS OffsetParent属性