javascript实现三维(三维的缩写)切换焦点图
做了一个用鼠标拖拽配合CSS3的小尝试,截图如下:
熟悉拖拽效果的朋友应该不会陌生鼠标按住以后,左右拖动的实现方式。这个小演示里尝试的是把CSS3中的相关知识点运用到图片展示中,当拖动图片时,显示出立体的感觉~~
直接代码如下:
# list { width:400px高度:440 px余量:30px自动30px位置:相对;z指数:500;} # list li { height:40px宽度宽度:400像素位置:相对;光标:指针指针;-web套件-透视图:800 px} # list li div { height:40px宽度width:400px-web套件-transform-style : preserve-3d;-网页套件-背面-可见性:隐藏;位置:相对;-web套件-transform : translatez(-200 px);-webkit-transform:50ms全线性;} #列表跨度{ height:40px宽度宽度:400像素位置:绝对;左侧left:0top:0飞越:隐藏;} # list div span : th-child(1){ background : URL(img/1。jpg)不重复;-网络套件-transform : translatez(200px);} # list div span : th-child(2){ background : URL(img/2。jpg)不重复;-web kit-transform-origin :右;-web套件-transform : translate ez(200 px)Rotatey(-90);} # list div span : th-child(3){ background : URL(img/3。jpg)不重复;-web kit-transform-origin :右;-web套件-transform : translatez(-200 px);} # list div span : th-child(4){ background : URL(img/4。jpg)不重复;-web kit-transform-origin :左侧;-web套件-transform : translate ez(200 px)Rotatey(90);} # list em { width:400px高度:400 px位置:绝对;左转:0背景技术: # 666;} #列出李em :的类型(1){-web kit-transform-origin : top;-web套件-transform : translatez(200 px)Rotatex(-90);top:0} #列表Li em : of-type(2){-web kit-transform-origin :垫底;-web套件-transform : translate ez(200 px)Rotatex(90);底部:0;} # list Li : th-last-child(1){ z-index :10;} # list Li : th-last-child(2){ z-index :20;} # list Li : th-last-child(3){ z-index :30;} # list Li : th-last-child(4){ z-index :40;} # list Li : th-last-child(5){ z-index :50;} # list Li : th-last-child(6){ z-index :60;} # list Li : th-child(2)span { background-position :0-40px;} # list Li : th-child(3)span { background-position :0-80px;} # list Li : th-child(4)span { background-position :0-120 px;} # list Li : th-child(5)span { background-position :0-160 px;} # list Li : th-child(6)span { background-position :0-200 px;} # list Li : th-child(7)span { background-position :0-240 px;} #列表李: th-child(8)span {背景-位置:0-280 px;} # list Li : th-child(9)span { background-position :0-320 px;} # list Li : th-child(10)span { background-position :0-360 px;} # list Li : th-child(11)span { background-position :0-400 px;} # btns { width :130 pxmargin :0 auto } # btns Li { width :20 px高度:20 px背景# ff font-size :14 px;字体粗细:加粗;文本对齐:居中;线高:20 pxfloat : leftcolor : # f60 margin 33600 3pxcursor :指针指针;} # btns .活动{ background : # f60 color : # fff } HTML
ul % 20 id % 3D % 27列表% 27% 20li % 20 div % 20 span % 2 Fspan % 20 span % 20 span % 2 Fspan % 20 em % 2 Fem % 20 em % 2 Fem % 20% 2 Fdiv % 20% 2 Fli % 20li % 20 div % 20 span % 2 Fspan % 20 span % 2 Fspan % 20 span % 20 span % 20 span % 2 Fspan % 20 span % 20 span % 20 span % 20 span % 20 span % 20 span
版权声明:javascript实现三维(三维的缩写)切换焦点图是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。