求源代码呀,怎么敲都

来源:3-2 JS部分

qq_美丽的曲线_03762593

2016-11-09 20:59

求源代码呀 怎么敲都不对

写回答 关注

4回答

  • Yinsion_Nie
    2016-11-12 15:09:29
    已采纳

    当然,你也可以使用我的代码

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>CSS3 创建翻页效果</title>
        <style type="text/css">
            .wrap {
                -webkit-perspective: 800;
                -webkit-perspective-origin: center;
                overflow: hidden;
            }
            
            .wrapContent {
                width: 400px;
                height: 400px;
                margin: 0 auto;
                position: relative;
                -webkit-transform-style: preserve-3d;
            }
            
            .pages {
                width: 400px;
                height: 400px;
                position: absolute;
                top: 0;
                left: 0;
                font-size: 400px;
                font-weight: bold;
                line-height: 400px;
                text-align: center;
                color: #fff;
                background-color: #69e;
                -webkit-transform-origin: bottom;
                -webkit-transform: rotateX(90deg);
                -webkit-transition: -webkit-transform 1s linear;
            }
            
            .page1 {
                -webkit-transform: rotateX(0deg);
            }
            
            .controller {
                margin: 10px auto;
                text-align: center;
            }
            
            .controller span {
                width: 80px;
                height: 30px;
                line-height: 30px;
                border: 1px solid #ccc;
                margin-right: 10px;
                display: inline-block;
                cursor: pointer;
            }
        </style>
    </head>
    <body>
        <div>
            <div>
                <div class="pages page1">1</div>
                <div class="pages page2">2</div>
                <div class="pages page3">3</div>
                <div class="pages page4">4</div>
                <div class="pages page5">5</div>
                <div class="pages page6">6</div>
            </div>
        </div>
        <div>
            <span id="next" onclick="next();">next</span>
            <span id="previous" onclick="previous();">previous</span>
        </div>
        
        <script type="text/javascript">
            var curIndex =1;
            function next() {
                if(curIndex == 6) {
                    return;
                }else {
                    var curPage = document.getElementsByClassName("page" + curIndex);
                    curPage[0].style.webkitTransform = 'rotateX(-90deg)';
                    curIndex ++;
                    var nextPage = document.getElementsByClassName("page" + curIndex);
                    nextPage[0].style.webkitTransform = 'rotateX(0deg)';
                }
            }
            
            function previous() {
                if(curIndex == 1) {
                    return;
                }else {
                    var curPage = document.getElementsByClassName("page" + curIndex);
                    curPage[0].style.webkitTransform = 'rotateX(90deg)';
                    curIndex --;
                    var nextPage = document.getElementsByClassName('page' + curIndex);
                    nextPage[0].style.webkitTransform = 'rotateX(0deg)';
                }
            }    
        </script>
    </body>
    </html>


    qq_美丽的...

    非常感谢!

    2018-08-24 16:09:28

    共 1 条回复 >

  • 李裹富
    2018-08-12 12:55:20

      demo地址->  http://hilij.com/demo/page3D.html

  • qq_美丽的曲线_03762593
    2016-11-13 10:55:30

    已经找到了  谢谢亲爱的们

  • 咸鱼一只
    2016-11-10 13:39:58

    退回这个课的主页右边有资料下载

CSS3 3D 特效

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

78574 学习 · 425 问题

查看课程

相似问题