• No.4


    参考

    ①张鑫旭http://www.zhangxinxu.com/wordpress/2012/09/css3-3d-transform-perspective-animate-transition/

    ②CODEPEN优秀 圣诞老人https://codepen.io/Alireza29675/pen/KwgwMy


    代码

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Reverse</title>
    </head>
    <style>
        .divin{
            /*perspective: 800px;*/
            width: 250px;
            height: 350px;
        }
        .down{
            /*perspective: 800px;*/
            width: 250px;
            height: 350px;
            position: relative;
            top:-350px;
            transform:rotateY(180deg);
        }
        .out{
            backface-visibility: hidden;
            position: absolute;
            left: 800px;
            perspective: 800px;
            width: 250px;
            height: 350px;
            transform-style: preserve-3d;
            transition: transform 0.5s linear;    
        }
    </style>
    <body>
        <div class="out">
        <div class="divin" onclick="rotate()"><img src="C:UsersAdministratorDesktopife%2F任务四设计稿任务四设计稿正面.jpg" alt="up"></div>
        <div class="down"><img src="C:UsersAdministratorDesktopife%2F任务四设计稿任务四设计稿反面.jpg" alt="down"></div>
        </div>
    </body>
    <script>
        function rotate(){
        var b1 = document.querySelector(".out");
        b1.style.transform = "rotateY(180deg)";
    }
    </script>
    </html>

    主要点

    ①perspective属性

    ②transform-style:preserve-3d;

    ③backface-visibility:hidden

  • 相关阅读:
    c# 泛型委托
    c# 用户自定义转换
    c# 溢出上下文检测
    c# 接口相同方法申明使用
    c# 事件的订阅发布Demo
    c# 匿名方法几种表现形式
    c# 数组协变
    c# 交错数组
    C# 位运算详解
    ABAP 7.4 新语法-内嵌生命和内表操作(转)
  • 原文地址:https://www.cnblogs.com/cndotabestdota/p/9112144.html
Copyright © 2020-2023  润新知