<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<style>
* {
padding:0;
margin:0;
}
. container {
width:560px;
height:380px;
margin:100px Auto;
border:1px solid #000;
position:relative;
Display:flex;
}
. Container a {
Text-decoration:none;
Position:absolute;
width:60px;
height:60px;
line-height:60px;
Font-weight:bold; " >grey;
Color:white;
Text-align:center;
font-size:60px;
top:160px;
}
. before {
Left: -30px;
}
. After {
Right: -30px;
}
. Items {
List-style:none;
padding:0;
width:100%;
height:100%;
position:relative;
transform-style:preserve-3d;
Transition:all 1s;
}
. Item {
width:100%;
height:100%;
Position:absolute;
}
. Item:nth-child (1) {
Background:url (img/02.jpg);
Transform:rotatex (0deg) Translatez (190px);
}
. Item:nth-child (2) {
Background:url (img/03_kis.jpg);
Transform:rotatex (180deg) Translatez (190px);
}
. Item:nth-child (3) {
Background:url (img/04.jpg);
Transform:rotatex (90deg) Translatez (190px);
}
. Item:nth-child (4) {
Background:url (img/04_kiss.jpg);
Transform:rotatex ( -90deg) Translatez (190px);
}
. Items:nth-child (2). Item {
Background-position: -140px 0px;
}
. Items:nth-child (3). Item {
Background-position: -280px 0px;
}
. Items:nth-child (4). Item {
Background-position: -420px 0px;
}
</style>
<script src= "Js/jquery-3.0.0.min.js" ></script>
<script>
var num = 0;
$ (function () {
$ (". Before"). Click (function () {
num++;
$ (". Items"). each (function (index,element) {
SetTimeout (function () {
$ (Element). css ({
Transform: "Rotatex (" +num*90+ "deg)"
})
},INDEX*100)
})
})
$ (". After"). Click (function () {
num--;
$ (". Items"). each (function (index,element) {
SetTimeout (function () {
$ (Element). css ({
Transform: "Rotatex (" +num*90+ "deg)"
})
},INDEX*100)
})
})
})
</script>
<body>
<div class= "Container" >
<ul class= "Items" >
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
</ul>
<ul class= "Items" >
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
</ul>
<ul class= "Items" >
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
</ul>
<ul class= "Items" >
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
<li class= "Item" ></li>
</ul>
<a href= "javascript:void (0)" class= "before" ><</a>
<a href= "javascript:void (0)" class= "after" >></a>
</div>
</body>
H5C3 Split-type carousel diagram with jquery