绕Y轴旋转翻页效果有问题
为什么改成绕Y轴旋转,翻页的时候第一页卡在那里?不是已经绕Y轴转了90度,应该看不到才对啊.....麻烦大神看下代码。
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>3D Calendar</title> <style> #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; } .page{ width:360px; height:360px; padding:20px; color:white; background-color: black; font-weight:bold; font-size:360px; line-height:360px; text-align:center; position:absolute; } #page1{ -webkit-transform-origin:left; -webkit-transition:-webkit-transform 1s linear; } #page2,#page3,#page4,#page5,#page6,#page7{ -webkit-transform-origin:left; -webkit-transition:-webkit-transform 1s linear; -webkit-transform:rotateY(90deg); } .operation{ text-align:center; margin:40px auto; } </style> <script type="text/javascript"> var curIndex=1; function next(){ if(curIndex==7) return; var curPage=document.getElementById("page"+curIndex); curPage.style.webkitTransform="rotateY(-90deg)"; curIndex++; var nextPage=document.getElementById("page"+curIndex); nextPage.style.webkitTransform="rotateY(0deg)"; } function previous(){ if(curIndex==1) return; var curPage=document.getElementById("page"+curIndex); curPage.style.webkitTransform="rotateY(90deg)"; curIndex--; var nextPage=document.getElementById("page"+curIndex); nextPage.style.webkitTransform="rotateY(0deg)"; } </script> </head> <body> <div id="my3dspace"> <div id="pagegroup"> <div id="page1">1</div> <div id="page2">2</div> <div id="page3">3</div> <div id="page4">4</div> <div id="page5">5</div> <div id="page6">6</div> <div id="page7">7</div> </div> </div> <div> <a href="javascript:previous()">previous</a> <a href="javascript:next()">next</a> </div> </body> </html>