03-offsetParent属性
2024-08-23 00:31:59
<!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>
最新文章
- Oracle_多表查询
- October 20th Week 43rd Thursday, 2016
- Angular JS中 Promise用法
- PL/0编译器(java version) - Err.java
- XAF学习笔记之 Upcasting
- 在C#中IEnumerable与IEnumerator
- hdu 2795 线段树
- lastIndexOf方法——获取字符最后的索引
- 编写WCF服务时右击配置文件无“Edit WCF Configuration”(编辑 WCF 配置)远程的解决办法
- IBM WebSphere ESB入门指南
- Session的过期时间如何计算?
- 吴恩达机器学习笔记2-代价函数I(cost function)
- 从a文件判断是否删除b文件中的行(sed示例)
- console控制台的小问题
- Codeforces 359E Neatness
- Hudson与Jenkins
- Linux引导程序类型
- STM32 TIMER DIAGRAM
- Linux学习13-CentOS安装ab做压力测试
- (转)Mysql 多表查询详解