hct楚
2016-02-20 19:53
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
#dspace{
perspective:800;
perspective-origin:50% 50%;
-webkit-perspective:800;
-webkit-perspective-origin:50% 50%;
-moz-perspective:800;
-moz-perspective-origin:50% 50%;
overflow:hidden;
}
#pageground{
width:400px;
height:400px;
margin:0 auto;
transform-style:preserve-3d;
-webkit-transform-style:preserve-3d;
-moz-transform-style:preserve-3d;
position:relative;
}
.page{
width:360px;
height:360px;
padding:20px;
background-color:#000;
color:#fff;
font-weight:bold;
font-size:360px;
line-height:360px;
text-align:center;
position:absolute;
}
#page1{
transform-origin:bottom;
transition:transform 1s linear;
-webkit-transform-origin:bottom;
-webkit-transition:-webkit-transform 1s linear;
-moz-transform-origin:bottom;
-moz-transition:-moz-transform 1s linear;
}
#page2,#page3,#page4,#page5,#page6,#page7,#page8{
transform-origin:bottom;
transition:transform 1s linear;
transform:rotateX(90deg);
-webkit-transform-origin:bottom;
-webkit-transition:-webkit-transform 1s linear;
-webkit-transform:rotateX(90deg);
-moz-transform-origin:bottom;
-moz-transition:-moz-transform 1s linear;
-moz-transform:rotateX(90deg);
}
#op{
text-align: center;
margin: 50px auto;
}
</style>
</head>
<body>
<div id="dspace">
<div id="pageground">
<div class="page" id="page1">1</div>
<div class="page" id="page2">2</div>
<div class="page" id="page3">3</div>
<div class="page" id="page4">4</div>
<div class="page" id="page5">5</div>
<div class="page" id="page6">6</div>
<div class="page" id="page7">7</div>
<div class="page" id="page8">8</div>
</div>
<div id="op">
<a href="javascript:next()">next</a>
<a href="javascript:prev()">prev</a>
</div>
</div>
<script type="text/javascript">
var curIndex=1;
function next () {
if (curIndex==8) {
return;
};
var curPage=document.getElementById("page"+curIndex);
curPage.style.transform="rotateX(-90deg)";
curIndex++;
var nextPage=document.getElementById("page"+curIndex);
nextPage.style.transform="rotateX(0)";
}
function prev () {
if (curIndex==1) {
return;
};
var curPage=document.getElementById("page"+curIndex);
curPage.style.transform="rotateX(90deg)";
curIndex--;
var prevPage=document.getElementById("page"+curIndex);
prevPage.style.transform="rotateX(0deg)";
}
</script>
</body>
</html>
这是我的代码,在火狐上可以显示,但效果和视频的不太一样,在谷歌上1就显示在下面,当我在#pageground加上overflow:hidden;时,谷歌可以显示但却是反着来的,火狐上的效果就变了更不一样了,求大神指教,拜托拜托
perspective:800px;
perspective-origin:center 400px;
视点不对
CSS3 3D 特效
78572 学习 · 425 问题
相似问题