鼠标悬停,图片360度旋转
效果:
代码:
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
知识点:CSS3 的transform 属性可以向元素应用 2D 或 3D 转换。该属性允许我们对元素进行旋转、缩放、移动或倾斜。设置为rotateZ(angle) 实现DOM元素沿着 Z 轴的 3D 旋转,相关的设置还有rotate、rotate3d、rotateX、rotateY。
立即学习
“
前端免费学习笔记(深入)
”;
图片悬停放大
效果:
代码:
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
知识点: 同样用到CSS3的transform属性,设置scale(x,y),实现DOM元素的2D缩放转换,相关的还有scale3d、scaleX、scaleY、scaleZ
使用HTML,CSS,JavaScript开发Android应用程序 英文文字pdf版附源文件
如果你了解HTML,CSS和JavaScript,您已经拥有所需的工具开发Android应用程序。本动手本书展示了如何使用这些开源web标准设计和建造,可适应任何Android设备的应用程序 - 无需使用Java。您将学习如何创建一个在您选择的平台的Android友好的网络应用程序,然后转换与自由PhoneGap框架到一个原生的Android应用程序。了解为什么设备无关的移动应用是未来的潮流,并开始构建应用程序,提供更
下载
实现3D图片旋转相册
效果:
代码:
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
CRLF
知识点: 还是凭借CSS3的transform属性以及animation属性,使用rotateY定义元素沿着 Y 轴的进行 3D 旋转,使用translateZ定义元素沿着Z轴进行 3D 转换;
同时设置元素的animation属性实现动画效果,本文中定义如下:
CRLF
animation-name(需要绑定到选择器的 keyframe 名称):rotation的动画
animation-duration(完成动画所花费的时间):20s
animation-iteration-count(动画应该播放的次数):infinite(无限次)
animation-timing-function(动画的速度曲线):linear(动画从头到尾的速度是相同的)
更多纯Css3手工打造网页图片效果 相关文章请关注PHP中文网!
.rotate-demo { width: 220px; height: 220px; margin: 0 auto; background: no-repeat url("images/author.jpg") left top; -webkit-background-size: 220px 220px; -moz-background-size: 220px 220px; background-size: 220px 220px; -webkit-border-radius: 110px; border-radius: 110px; -webkit-transition: -webkit-transform 2s ease-out; -moz-transition: -moz-transform 2s ease-out; -o-transition: -o-transform 2s ease-out; -ms-transition: -ms-transform 2s ease-out; }
.rotate-demo:hover { -webkit-transform: rotateZ(360deg); -moz-transform: rotateZ(360deg); -o-transform: rotateZ(360deg); -ms-transform: rotateZ(360deg); transform: rotateZ(360deg); }
CSS3: .img-container { background-color: #000; width: 220px; height: 220px; margin: 20px 50px; }
.img { -webkit-transform: scale(0.6); -moz-transform: scale(0.6); -o-transform: scale(0.6); -webkit-transition-duration: 0.5s; -moz-transition-duration: 0.5s; -o-transition-duration: 0.5s; }
.img img { padding: 1px; border-radius: 10px; border: 1px solid #fff; }
.img:hover { -webkit-transform: scale(0.8); -webkit-box-shadow: 0px 0px 30px #ccc; -moz-transform: scale(0.8); -moz-box-shadow: 0px 0px 30px #ccc; -o-transform: scale(0.8); -o-box-shadow: 0px 0px 30px #ccc; }
HTML: CSS: .carousel-container { margin: 20px auto; width: 210px; height: 140px; position: relative; }
#carousel { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; animation: rotation 20s infinite linear; }
#carousel:hover { animation-play-state: paused; }
#carousel figure { display: block; position: absolute; width: 186px; height: 116px; left: 10px; top: 10px; background: black; overflow: hidden; border: solid 1px black; }
#carousel figure:nth-child(1) { transform: rotateY(0deg) translateZ(288px); }
#carousel figure:nth-child(2) { transform: rotateY(40deg) translateZ(288px); }
#carousel figure:nth-child(3) { transform: rotateY(80deg) translateZ(288px); }
#carousel figure:nth-child(4) { transform: rotateY(120deg) translateZ(288px); }
#carousel figure:nth-child(5) { transform: rotateY(160deg) translateZ(288px); }
#carousel figure:nth-child(6) { transform: rotateY(200deg) translateZ(288px); }
#carousel figure:nth-child(7) { transform: rotateY(240deg) translateZ(288px); }
#carousel figure:nth-child(8) { transform: rotateY(280deg) translateZ(288px); }
#carousel figure:nth-child(9) { transform: rotateY(320deg) translateZ(288px); }
#carousel .carousel-img { -webkit-filter: grayscale(1); cursor: pointer; transition: all .5s ease; border: none; }
#carousel .carousel-img:hover { -webkit-filter: grayscale(0); transform: scale(1.2,1.2); }
@keyframes rotation { from { transform: rotateY(0deg); }
to { transform: rotateY(360deg); } }
HTML:
animation: rotation 20s infinite linear;