张老师总结的,感谢!

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.test1-wrap,.test2-wrap{
border: 1px dashed #000;
margin-bottom: 20px;
}
/* 解决办法一 */
.test1-wrap .overflow{
overflow: hidden;
}
.test1-wrap .test1-top{
position: absolute;
width: 200px;
height: 50px;
background-color: green;
z-index: 999; /* 解决办法二 */
/* transform: translateZ(100px); */
}
.test1-wrap .test1-bot{
width: 100px;
height: 100px;
background-color: red;
transform: perspective(300px) rotateY(40deg);
} .test2-top{
width: 100px;
height: 100px;
background-color: red;
/* 照理说这个会在下面,可是加了这句话就会跑上来了 */
transform: scale(1);
}
.test2-bot{
margin-top: -50px;
width: 100px;
height: 100px;
background-color: green;
} .test3-top{
width: 100px;
height: 100px;
position: fixed;
top: 300px;
right: 0;
background-color: #000;
}
.test4-wrap{
width: 100px;
height: 100px;
border: 10px solid #000;
overflow: hidden;
margin-bottom: 100px;
}
.test4-top{
width: 150px;
height: 150px;
background-color: green;
position: absolute;
}
.test5-wrap{
width: 200px;
height: 200px;
border: 1px solid #333;
transform: scale(1);
}
.test5-top{
position: absolute;
width: 100%;
height: 100%;
background-color: red;
}
</style>
</head>
<body style="height: 1000px;">
<!-- Safari 3D变化后忽略层级 -->
<div class="test1-wrap">
<div class="test1-top"></div>
<div class="overflow">
<div class="test1-bot"></div>
</div>
</div>
<!-- 提升元素的垂直地位 -->
<div class="test2-wrap">
<div class="test2-top"></div>
<div class="test2-bot"></div>
</div>
<!-- position:fixed变absolute -->
<div class="test3-wrap" style="transform: scale(1);">
<div class="test3-top"></div>
</div>
<!-- 正常是不会隐藏的 -->
<div class="test4-wrap">
<div class="test4-top"></div>
</div>
<!-- Chrome/Opera不行 -->
<div class="test4-wrap" style="transform:scale(1);">
<div class="test4-top"></div>
</div>
<!-- 都行 -->
<div class="test4-wrap">
<div style="transform:scale(1);">
<div class="test4-top"></div>
</div>
</div>
<!-- 对定位的影响 -->
<div class="test5-wrap">
<div class="test5-top">dsfsdfsdf</div>
</div>
</body>
</html>
function getCss(curEle,attr){
var val = null,reg = null;
// var val = reg = null;//这样写reg是全局的
if(window.getComputedStyle){
val = window.getComputedStyle(curEle,null)[attr];
}
else{// ie6-8
if(attr === "opacity"){
val = curEle.currentStyle["filter"];// alpha(opacty=10)
reg = /^alpha\(opacity=(\d+(?:\.\d+)?)\)$/i;
val = reg.test(val) ? reg.exec(val)[] / : ;
}
else{
val = curEle.currentStyle[attr];
}
} reg = /^(-?\d+(\.\d+)?)(px|pt|rem|em)?$/i;
return reg.test(val) ? parseFloat(val) : val;
}

小心transform的更多相关文章

  1. 小心 CSS3 Transform 引起的 z-index "失效"

    https://www.douban.com/note/343402554/ http://www.jb51.net/css/255811.html 最后我直接removeClass;把transfo ...

  2. CSS3 2D Transform

    在 一个二维或三维空间,元素可以被扭曲.移位或旋转.只不过2D变形工作在X轴和Y轴,也就是大家常说的水平轴和垂直轴:而3D变形工作在X轴和Y轴之外, 还有一个Z轴.这些3D变换不仅可以定义元素的长度和 ...

  3. transform.localPosition操作时的一些注意事项

    移动GameObject是非常平常的一件事情,一下代码看起来很简单: transform.localPosition += new Vector3 ( 10.0f * Time.deltaTime, ...

  4. Gameobject.Find和Transform.Find应用区别

    using UnityEngine;using System.Collections; public class test : MonoBehaviour{ private GameObject ro ...

  5. Transform 引起的 z-index "失效"

    重新学习CSS后的第三天,学习制作阴影的过程中,发现的问题:设置了box-shadow后展现的阴影: 添加transform:rotate(10deg);后的效果: 查看CodePen例子:阴影效果 ...

  6. 【OI向】快速傅里叶变换(Fast Fourier Transform)

    [OI向]快速傅里叶变换(Fast Fourier Transform) FFT的作用 ​ 在学习一项算法之前,我们总该关心这个算法究竟是为了干什么. ​ (以下应用只针对OI) ​ 一句话:求多项式 ...

  7. 如何一步一步用DDD设计一个电商网站(九)—— 小心陷入值对象持久化的坑

    阅读目录 前言 场景1的思考 场景2的思考 避坑方式 实践 结语 一.前言 在上一篇中(如何一步一步用DDD设计一个电商网站(八)—— 会员价的集成),有一行注释的代码: public interfa ...

  8. CSS3 3D立方体效果-transform也不过如此

    CSS3系列已经学习了一段时间了,第一篇文章写了一些css3的奇技淫巧,原文戳这里,还获得了较多网友的支持,在此谢过各位,你们的支持是我写文章最大的动力^_^. 那么这一篇文章呢,主要是通过一个3D立 ...

  9. 深入node之Transform

    Transform流特性 在开发中直接接触Transform流的情况不是很多,往往是使用相对成熟的模块或者封装的API来完成流的处理,最为特殊的莫过于through2模块和gulp流操作.那么,Tra ...

随机推荐

  1. gitbook 的资源同步到 github中(方便维护和备份)

    进入SETTINGS -> Github -> Select a Repository. 到这一步为止,我们可以先去我们的github,创建一个仓库先,推荐同名.然后回来gitbook中, ...

  2. myql5.7.7优化配置參数

    # Other default tuning values # MySQL Server Instance Configuration File # ------------------------- ...

  3. 初识Dubbo 系列之6-Dubbo 配置

    配置 Xml配置 配置项说明 具体配置项,请參见:配置參考手冊 (+) API使用说明 假设不想使用Spring配置.而希望通过API的方式进行调用,请參见:API配置 (+) 配置使用说明 想知道怎 ...

  4. 使用HTML5制作简单的RPG游戏

    很久以前就想着做一个游戏,但什么都不会又不知道从哪里开始,胡乱找来一些书籍和资料结果太深奥看不懂,无奈只能放弃.这一弃就是十多年,倥偬半生,眼看垂垂老矣,还是没能有什么成果. 近年来游戏引擎越来越多, ...

  5. 【GoldenGate】使用OGG,两个Oracle库之间单向同步数据

    ************************************************************************ ****原文:blog.csdn.net/clark_ ...

  6. 【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

    初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi ...

  7. Ejabberd作为推送服务的优化手段(转)

    AVOS Cloud目前还在用Ejabberd做Android的消息推送服务.当时选择Ejabberd,是因为Ejabberd是一个发展很长时间的XMPP实现,并且基于Erlang,设想能在我们自主研 ...

  8. Top 10 Open Source Bug Tracking System系统

    Bugzilla http://www.bugzilla.org/ Mantis php http://www.mantisbt.org/ Trac Python also provides wiki ...

  9. PowerBuilder -- 数据窗口

    获取数据窗口列数 ls_colnum= integer(this.Describe("DataWindow.Column.Count")) 获取数据窗口列名 ls_colName ...

  10. WPF自定义搜索框代码分享

    首先下载搜索图标: 控件中的搜索图标下载地址:http://www.easyicon.net/1183666-Search_icon.html 搜索框设计过程比较简单: 1.先定义一个Rectangl ...