天天看點

bootsrap 實作圖檔翻轉

聽說病毒傳播已經出現拐點了,希望早日解禁。昨天寫的拼圖沒有調通。今天寫了個簡單的。

bootsrap 實作圖檔翻轉
bootsrap 實作圖檔翻轉
直接上代碼

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>圖檔翻轉</title>
    <link rel="stylesheet" href="./images0130/bootstrap/css/bootstrap.min.css">
    <style>
        .wrapper {
            padding: 30px;
        }

        .wrapper .box {
            position: relative;
            perspective: 1000px;
        }

        .wrapper .box img {
            width: 100%;
        }

        .wrapper .box .box-img {
            transform: rotateY(0deg);
            transition: all 0.5s ease-in;
        }

        .wrapper .box:hover .box-img {
            transform: rotateY(-90deg);
        }

        .wrapper .box:hover .box-con {
            transform: rotateY(0deg);
        }

        .wrapper .box .box-con {
            position: absolute;
            top: 0;
            width: 100%;
            height: 100%;
            background-color:rgba(0,0,0,0.7);
            transform: rotateY(90deg);
            transition: all 0.5s ease-in;
            color: #fff;
            text-align: center;
            padding: 15px;

        }

    </style>
</head>

<body>
    <div class="wrapper">
        <div class="container">
            <div class="row">
                <div class="col-md-3 col-sm-6">
                    <div class="box">
                        <div class="box-img"><img src="./images0130/timg.jpeg" alt=""></div>
                        <div class="box-con">
                            <h4 class="title">标題</h4>
                            <p class="des">test$</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-3 col-sm-6">
                    <div class="box">
                        <div class="box-img"><img src="./images0130/timg.jpeg" alt=""></div>
                        <div class="box-con">
                            <h4 class="title">标題</h4>
                            <p class="des">test$</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-3 col-sm-6">
                    <div class="box">
                        <div class="box-img"><img src="./images0130/timg.jpeg" alt=""></div>
                        <div class="box-con">
                            <h4 class="title">标題</h4>
                            <p class="des">test$</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-3 col-sm-6">
                    <div class="box">
                        <div class="box-img"><img src="./images0130/timg.jpeg" alt=""></div>
                        <div class="box-con">
                            <h4 class="title">标題</h4>
                            <p class="des">test$</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

    <script src="./images0130/bootstrap/js/bootstrap.min.js"></script>
</body>

</html>           

繼續閱讀