function prev(){
if(curIndex==1){return;}
var curPage=document.getElementById("page"+curIndex);
curPage.style.webkitTransform="rotatex(90deg)"
curIndex--;
var nextPage=document.getElementById("page"+curIndex);nextPage.style.webkitTransform="rotatex(0deg)"}
if(curIndex==1){return;}
var curPage=document.getElementById("page"+curIndex);
curPage.style.webkitTransform="rotatex(90deg)"
curIndex--;
var nextPage=document.getElementById("page"+curIndex);nextPage.style.webkitTransform="rotatex(0deg)"}
var curIndex=1;
function next(){
if(curIndex==6){return;}
var curPage=document.getElementById("page"+curIndex);
curPage.style.webkitTransform="rotatex(-90deg)"
curIndex++;
var nextPage=document.getElementById("page"+curIndex);nextPage.style.webkitTransform="rotatex(0deg)"}
function next(){
if(curIndex==6){return;}
var curPage=document.getElementById("page"+curIndex);
curPage.style.webkitTransform="rotatex(-90deg)"
curIndex++;
var nextPage=document.getElementById("page"+curIndex);nextPage.style.webkitTransform="rotatex(0deg)"}
#page1{
-webkit-transform-origin:bottom;
-webkit-transition:-webkit-transform 1s linear;}
#page2,#page3,#page4,#page5,#page6{
-webkit-transform-origin:bottom;
-webkit-transition:-webkit-transform 1s linear;
-webkit-transform:rotatex(90deg);}
#op{text-align: center;
margin: 40px auto;}
-webkit-transform-origin:bottom;
-webkit-transition:-webkit-transform 1s linear;}
#page2,#page3,#page4,#page5,#page6{
-webkit-transform-origin:bottom;
-webkit-transition:-webkit-transform 1s linear;
-webkit-transform:rotatex(90deg);}
#op{text-align: center;
margin: 40px auto;}
.page{
width: 360px;
height: 360px;
padding: 20px;
background-color: #156;
color: #236;
font-size: 360px;
font-weight: bold;
line-height: 360px;
text-align: center;
position: absolute;
}
width: 360px;
height: 360px;
padding: 20px;
background-color: #156;
color: #236;
font-size: 360px;
font-weight: bold;
line-height: 360px;
text-align: center;
position: absolute;
}
#my3dspace{
-webkit-perspective:800;
-webkit-perspective-origin:50% 50%;
overflow: hidden;}
#pagegroup{
width: 400px;
height: 400px;
margin: 0 auto;
-webkit-transform-style:preserve-3d;
position:relative;
}
-webkit-perspective:800;
-webkit-perspective-origin:50% 50%;
overflow: hidden;}
#pagegroup{
width: 400px;
height: 400px;
margin: 0 auto;
-webkit-transform-style:preserve-3d;
position:relative;
}
看到很多同学说看不清,我贴上了源代码,方便大家学习(我用的是chrome浏览器)试过了,效果和老师一样。至于没有效果的同学,可能是某个地方敲错了英文(不要问我为什么知道),因为webkit好像是白体字(用的是sublime写的代码)不能检错,所以要格外注意,使用代码时,建议考虑浏览器兼容性。代码字数限制,我就只贴css和js部分了。见下条评论。