js幻灯片代码3D分块旋转轮播图免费源码分享
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
| <!DOCTYPE HTML>
<html>
<head>
<title>js幻灯片代码3D分块旋转轮播图免费源码分享</title>
<meta charset="utf-8">
<meta name="Author" content="js幻灯片代码3D分块旋转轮播图免费源码分享">
<style type='text/css' id='css'>
*{ margin:0; padding:0; list-style:none;}
#wrap{
width:800px;
height:360px;
margin:450px auto;
position:relative;
}
#pic{
width:800px;
height:360px;
perspective:800px;
}
#pic ul li{
width:200px;
height:360px;
float:left;
position:relative;
transform-style:preserve-3d;
transform:translateZ(-180px);
}
#pic ul li div{
width:200px;
height:360px;
position:absolute;
top:0;
left:0;
}
#pic ul li div:nth-child(1){
top:-360px;
transform-origin:bottom;
transform:translateZ(180px) rotateX(90deg);
background-image:url(img/1.png);
}
#pic ul li div:nth-child(2){
top:360px;
transform-origin:top;
transform:translateZ(180px) rotateX(-90deg);
background-image:url(img/2.png);
}
#pic ul li div:nth-child(3){
transform:translateZ(180px);
background-image:url(img/3.png);
}
#pic ul li div:nth-child(4){
transform:translateZ(-180px) rotateX(180deg);
background-image:url(img/4.png);
}
#pic ul li:nth-child(1) div{
background-position:0 0;
}
#pic ul li:nth-child(2) div{
background-position:-200px 0;
}
#pic ul li:nth-child(3) div{
background-position:-400px 0;
}
#pic ul li:nth-child(4) div{
background-position:-600px 0;
}
#pic ul li:nth-child(1){
transition:1s 0s;
}
#pic ul li:nth-child(2){
transition:1s .1s;
}
#pic ul li:nth-child(3){
transition:1s .2s;
}
#pic ul li:nth-child(4){
transition:1s .3s;
}
#tab{
position:absolute;
width:100px;
height:20px;
right:10px;
bottom:10px;
}
#tab ul li{
width:20px;
height:20px;
background:#999;
color:#fff;
font-size:12px;
text-align:center;
line-height:20px;
font-family:'Microsoft yahei';
float:left;
cursor:pointer;
margin:0 2px;
border-radius:100%;
}
#tab ul li.on{
background:#f60;
}
/*
#pic:hover ul li{
transform:translateZ(-180px) rotateX(180deg);
}
*/
</style>
</head>
<body>
<div id="wrap">
<div id="pic">
<ul>
<li><div></div><div></div><div></div><div></div></li>
<li><div></div><div></div><div></div><div></div></li>
<li><div></div><div></div><div></div><div></div></li>
<li style='z-index:-1;'><div></div><div></div><div></div><div></div></li>
</ul>
</div>
<div id="tab">
<ul>
<li class='on'>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
</div>
<script type="text/javascript">
var tabLi = document.getElementById('tab').getElementsByTagName('li');
var oCss = document.getElementById('css');
for ( var i=0;i<tabLi.length;i++ )
{
tabLi[i].i = i;
tabLi[i].onclick = function(){
for (var j=0;j<tabLi.length;j++ )
{
tabLi[j].className = '';
}
this.className = 'on';
oCss.innerHTML += '#pic ul li{transform:translateZ(-180px) rotateX('+ -90 * this.i +'deg);}';
};
}
</script>
</body>
</html> |
「梦想一旦被付诸行动,就会变得神圣,如果觉得我的文章对您有用,请帮助本站成长」
共 0 条评论关于"js幻灯片代码3D分块旋转轮播图免费源码分享"
最新评论