一最安 2021-09-16 02:20 采纳率: 84.4%
浏览 26
已结题

请问如何使用css和js实现多个页面3d翻页?

img


如图,想实现该本书多个页面点击后翻页,该如何设置?望赐教。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            height: 100vh;
            background-image: radial-gradient(white,black);
           
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .shu{
            position: relative;
            width: 300px;
            height: 400px;
            background-color: rgba(255, 255, 255, 0.774);
            transform-style:  preserve-3d;
            box-shadow:   300px 0px 30px  rgb(0, 0, 0,.6) inset;
            transition: 1s cubic-bezier(.79,.34,.47,.92);
        }
        .shu::after{
            content: '';
            position: absolute;
            height: 3px;
            width: 303px;
            left: 0px;
            bottom: -3px;
           /*  background-color: rgb(100, 96, 96); */
           background-image: linear-gradient(to right,rgb(71, 68, 68),rgba(124, 120, 120, 0.3) );
            border-bottom-left-radius: 5px;
        }
        .shu::before{
            content: '';
            position: absolute;
            width: 3px;
            height: 100%;
            right: -3px;
            top: 0px;
            background-color: rgb(112, 108, 108);
           background-image: linear-gradient(to top,rgb(114, 111, 111),rgba(90, 87, 87, 0.5) );;
            border-top-right-radius: 3px;
        }

        .shu:hover{
            box-shadow:   30px 0px 30px  rgb(0, 0, 0,.6) inset;
            transform: rotate(-5deg);

        }
        .feng{
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: 2;
            background-image: url(img/22.jpg);
            background-size: 100% ;
            transform-origin: left;
            transition: 1s cubic-bezier(.79,.34,.47,.92);
            border-top-left-radius: 2px;
            border-bottom-left-radius: 2px;
           
           
        }
        .shu:hover .feng{
            transform: rotateY(-140deg);
            
        }

       
        .wen{
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            font-family: 'fangsong';
            text-align: left;
            background-color: red;
        }
    </style>
</head>
<body>
   <div class="shu">
       <div class="feng"></div>     
       <div class="wen" onclick="change()">
        <div class="page1">
            <h3 style="padding-top: 50px;padding-left: 40px;">Life of Pi</h3>
           <p style=" padding-top: 20px; padding-left: 40px;padding-right: 15px;">
            He lives in Scarborough. He's a small, slim man – nomore than five foot five. Dark hair, dark eyes. Hair greyingat the temples. Can't be older than forty.            leasingcoffee-coloured complexion1. Mild fall weather, yet puts on abig winter parka with fur-lined hood2 for the walk to thediner. 
           </p>
        </div>

        <div class="page2">第二页</div>

        <div class="page3">第三页</div>
           
       </div>
   </div>


   <script>
       function change(){
           console.log("翻页")
           var a=document.getElementsByClassName('wen')
           console.log("a:",a)
           a.style.transform= rotateY('-140deg');

       }
   </script>
</body>
</html>


  • 写回答

1条回答 默认 最新

问题事件

  • 系统已结题 9月26日
  • 已采纳回答 9月18日
  • 创建了问题 9月16日

悬赏问题

  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。
  • ¥15 stm32的can接口不能收发数据
  • ¥15 目标检测算法移植到arm开发板
  • ¥15 利用JD51设计温度报警系统