本案例主要是css3和html5,不会js也可以做动画◕.◕一、首先看下主要需要的样式:perspectivetransformtransitionpositionclassList就这么多,水平有限就不细讲啦!二、看效果:演示效果,runjs3个效果默认样式如上图 看起来好 ...
本案例主要是css3和html5,不会js也可以做动画◕.◕
一、首先看下主要需要的样式:
perspective
transform
transition
position
classList
就这么多,水平有限就不细讲啦!
二、看效果:演示效果,runjs
3个效果默认样式如上图
看起来好乱,还是看演示吧,不放图了==演示效果,runjs
三、html结构如下:
3个容器6个盒子,当鼠标经过时:
1.box1绕X轴(transform-origin默认容器中心),翻转180°至背面box2,鼠标移开翻回
2.box3绕Y轴(transform-origin默认容器中心),翻转180°至背面box4,鼠标移开翻回
3.box5,box6绕Z轴,(transform-origin分别为容器左右),翻转180°,鼠标移开翻回
<body> <div class="container" ontouchstart="this.classList.toggle('hover');"> <div class="box1"> <span>hello~</span> </div> <div class="box2"> <span>bye~</span> </div> </div> <div class="container" ontouchstart="this.classList.toggle('hover');"> <div class="box3"> <span>hello~</span> </div> <div class="box4"> <span>bye~</span> </div> </div> <div class="container" ontouchstart="this.classList.toggle('hover');"> <div class="box5"> <span>bye~</span> </div> <div class="box6"> <span>hello~</span> </div> </div></body>
原标题:CSS3—3D翻转
关键词:CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。