天天操天天操-欧美黄视频-亚洲午夜激情-黄色网址免费-少妇精品无码一区二区三区-欧美成人免费在线视频-国产毛片一区二区三区-欧美一区二区三区婷婷月色-四虎影视库-日本在线高清-毛片999-天天操欧美-国产午夜伦理-手机福利在线-视频在线91-免费在线观看亚洲-好爽快一点高潮了-国产污视频在线-成 人片 黄 色 大 片-激情久久网站-丰满少妇xxxx-女教师在办公室被躁在线播放-亚洲高清色-视色视频在线观看-婷婷色5月-又粗又硬又黄又爽的视频-好大好湿好硬顶到了好爽视频-中国美女黄色-国产精品刮毛-国内三级在线观看

CSS 3D 基礎(chǔ)知識(shí)

2017/2/11 8:32:47   閱讀:2012    發(fā)布者:2012

css3d 總結(jié)

3d transform (3D變形)(rotate skew scale translate)

基礎(chǔ)知識(shí)

perspective (視距,景深) perspective-origin (視點(diǎn))
transfrom

(1) 坐標(biāo) x y z

(2) 變形 基點(diǎn)位置 transform-origin
(3)transfrom-style:preserve-3d

3D旋轉(zhuǎn)圖片相冊(cè)

3d transform (3D變形)(rotate skew scale translate)

基礎(chǔ)知識(shí)

perspective (視距,景深) perspective-origin (視點(diǎn))
transfrom

(1) 坐標(biāo) x y z

(2) 變形 基點(diǎn)位置 transform-origin
(3)transfrom-style:preserve-3d

3D旋轉(zhuǎn)圖片相冊(cè)


它就用到了一個(gè)比較簡(jiǎn)單的坐標(biāo)y 軸旋轉(zhuǎn)那咱們看一下他的代碼

html的代碼:
	

首先要建九個(gè)盒子放九張圖片,這個(gè)很容易理解的。

css的代碼
body{ background: #6daf39;(背景加了個(gè)顏色 主要是好看) } .xj{ perspective:600px;(這是井深) } .kj{ transition: 1s;(運(yùn)動(dòng)時(shí)間) transform-style:preserve-3d;(實(shí)現(xiàn)3d效果 當(dāng)然這是非常重的) width:200px; height: 300px; margin:80px auto; position: relative; transform: rotateY(0deg) rotateX(0deg) translateZ(-275px); transform-origin: center center -275px; } .mian{ position:absolute; font-size: 50px; color:#fff; text-align: center; line-height: 300px; } .mian:nth-child(1){ width:200px; height: 300px; background: #ff2223; transform: rotateY(0deg)translateZ(275px); } .mian:nth-child(2){ width:200px; height: 300px; background: #ff2223; transform: rotateY(40deg)translateZ(275px); } .mian:nth-child(3){ width:200px; height: 300px; background: #ff2223; transform: rotateY(80deg)translateZ(275px); } .mian:nth-child(4){ width:200px; height: 300px; background: #ff2223; transform: rotateY(120deg)translateZ(275px); } .mian:nth-child(5){ width:200px; height: 300px; background: #ff2223; transform: rotateY(160deg)translateZ(275px); } .mian:nth-child(6){ width:200px; height: 300px; background: #ff2223; transform: rotateY(200deg)translateZ(275px); } .mian:nth-child(7){ width:200px; height: 300px; background: #ff2223; transform: rotateY(240deg)translateZ(275px); } .mian:nth-child(8){ width:200px; height: 300px; background: #ff2223; transform: rotateY(280deg)translateZ(275px); } .mian:nth-child(9){ width:200px; height: 300px; background: #ff2223; transform: rotateY(320deg)translateZ(275px); }

css就到這里,很簡(jiǎn)單的;

js的代碼
kj.onclick=function () { 
      cishu++; 
      var jiaodu=40*cishu; 


      kj.style.transform="rotateY("+jiaodu+"deg)translateZ(-275px)" 
    }

(kj)就是3d空間,點(diǎn)擊kj要是一種效果,就要有一種方法或步驟;
3d空間樣式rotateY(這就是上下軸旋轉(zhuǎn))translateZ(Z這就是3d立體字軸;
讓3d空間后移275px找到軸心位置)

完畢 希望大家看到這篇文章后能夠?qū)W到知識(shí)。