移动端transform-translateZ注册
【摘要】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
*{padding: 0px;margin: 0px;list-style: none;}
#div1
{
width: 200px;height: 200px;background: black;
position: absolute;left: 50%;top: 50%;margin: -100px 0 0 -100px;
transform-style: preserve-3d;
transform: perspective(800px);
transition: 1s;
}
#div1>#div2
{
width: 100%;height: 100%;background: green;position: absolute;
transform: translateZ(1px);/*3d变换中的移动,z中的正方向面向用户,值越大,越靠近用户。*/
}
#div1>#div3
{
width: 100%;
height: 100%;background: green;position: absolute;
transform:scaleX(-1) translateZ(-1px);
/*scaleX(-1)负数代表镜像*/
}
</style>
</head>
<body>
<script type="text/javascript">
window.onload=function()
{
var btn1=document.getElementById("btn1");
var btn2=document.getElementById("btn2");
btn1.onclick=function()
{
div1.style.transform='rotateY(180deg)';
}
btn2.onclick=function()
{
div1.style.transform="rotateY(180deg) translateY(-500px)";
div1.style.opacity=0;
}
}
</script>
<div id="div1">
<div id="div2">
<input type="button" value="我想注册" id="btn1">
</div>
<div id="div3">
用户名:
<input type="text"><br>
密码:<input type="password" name="" id="">
<input type="button" value="提交" id="btn2">
</div>
</div>
</body>
</html>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
文章来源: blog.csdn.net,作者:贵哥的编程之路(陈业贵),版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/qq_37805832/article/details/108877745
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)