张老师总结的,感谢!

 <!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. eclipse右下角总显示自动下载xml和jar,如何关闭

    windows->preference->查找download-选择Models->右侧下方Enable auto-download去掉 2.Automatic Updates-&g ...

  2. 19:ReverseNumber数字颠倒

    题目描述 描述:输入一个整数,将这个整数以字符串的形式逆序输出 程序不考虑负数的情况,若数字含有0,则逆序形式也含有0,如输入为100,则输出为001 输入描述:输入一个int整数 输出描述:将这个整 ...

  3. android 怎样加速./mk snod打包

    mm命令高速编译一个模块之后,一般用adb push到手机看效果,假设环境不同意用adb push或模块不常常改.希望直接放到image里,则能够用./mk snod,这个命令只将system文件夹打 ...

  4. oracle中视图V$PGA_TARGET_ADVICE的用法

    看一下这个视图能给我们带来什么样的信息(视图中每个列都很有帮助):sys@ora10g> SELECT   pga_target_for_estimate / 1024 / 1024 " ...

  5. Hadoop起源

    本文来自Doug Cutting为<Hadoop权威指南>所作之序,感觉读一下还是挺有收获的. Hadoop 起源于Nutch项目.我们几个人有一段时间一直在尝试构建一个开源的Web搜索引 ...

  6. uboot之run_command简单分析

    本文档简单分析了uboot中命令的实现.run_command函数的实现以及从uboot命令行接收并处理命令的过程. 作者: 彭东林 邮箱: pengdonglin137@163.com http:/ ...

  7. LINUX线程初探

     LINUX程序设计最重要的当然是进程与线程.本文主要以uart程序结合键盘输入控制uart的传输. 硬件平台:树莓派B+ 软件平台:raspberry 须要工具:USB转TTL(PL2303)+ ...

  8. Jquery EasyUI弹出窗体

    $("#btnCreate").click(function () { $("#modalwindow").html("<iframe widt ...

  9. Linux 批量替换的一种实现方式

    替换某目录下所有文件中的某个字符: sed -i 's/origin_str/new_str/g' `grep origin_str -rl ./` origin_str:被替换的字符串: new_s ...

  10. python 基础 1.5 python数据类型(三)--元组常用方法示例

    #/usr/bin/python#coding=utf-8#@Time :2017/10/13 15:02#@Auther :liuzhenchuan#@File :元组.py #tuple() 字符 ...