为了账号安全,请及时绑定邮箱和手机立即绑定

出不来效果

我用的是火狐的浏览器,但是代码是和老师一起敲打的,根本就没有错误,就是浏览器的问题,但是根本就出不来翻页的效果,看了好多遍,很是郁闷

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>日历的反转的设置</title>
<style>
#my3dspace{ 
-moz-perspective: 800px;
-moz-perspective-origin: 50% 50%;
overflow: hidden;
}
#mypage{
 height:400px;
 width:400px;
 margin: 0 auto;
 
-moz-transform-style: preserve-3d;
position: relative;
}
.page{
width:360px;
height:360px;
padding:20px;
background-color:black;
color:white;
font-weight:bold;
font-size:360px;
line-height:360px;
text-align:center;
position:absolute;
}
#page1{
    -moz-transform-origin:bottom; 
 -moz-transition:-moz-transform 1s linear;
}
#page2,#page3,#page4,#page5{
   -moz-transform-origin:bottom; 
   -moz-transition:-moz-transform 1s linear;
   -moz-transform: rotateX(90deg);
}
#op{
text-align:center;
margin:40px auto;
}
</style>
<script type="text/javascript">
var curIndex= 1;
function next(){
    if(curIndex ==5)
 return;
 var curPage = document.getElementById("page"+curIndex);
 alert("1");
 curPage.style.webkitTransform = "rotateX(-90deg)";
 alert("2");
 curIndex++;
 var nextPage = document.getElementById("page"+curIndex);
 alert("3");
 nextPage.style.webkitTransform = "rotateX(0deg)";
 alert("4");
 
 }
 function prev(){
 if(curIndex ==1)
 return;
  var curPage=document.getElementById("page"+curIndex);
  curPage.style.webkitTransform="rotateX(90deg)";
  curIndex--;
  var prevPage=document.getElementById("page"+curIndex);
  prevPage.style.webkitTransform="ratateX(0deg)";
  }
</script>
</head>
<body>
<div id="my3dspace">
<div id="mypage">
<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>
</div>
<div id="op">
<a href="javascript:next()">next</a>&nbsp;<a href="javascript:prev()">previous</a>
</div>
</body>
</html>

正在回答

1 回答

太多了,要自己调试

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
CSS3 3D 特效
  • 参与学习       78578    人
  • 解答问题       425    个

使用CSS3当中的属性,创建真实可用的三维效果

进入课程

出不来效果

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信