国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

基于jquery的手風琴圖片展示效果實現方法

2019-11-20 13:42:26
字體:
來源:轉載
供稿:網友

本文實例講述了基于jquery的手風琴圖片展示效果實現方法。分享給大家供大家參考。具體實現方法如下:

代碼運行效果如下圖所示:

index.html頁面代碼如下:

復制代碼 代碼如下:

<!DOCTYPE html>
<html class=''>
<head>
    <title>一款基于jquery的手風琴圖片展示效果demo</title>
    <style class="cp-pen-styles">
        div
        {
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
       
        html, body, .page-container
        {
            height: 100%;
            overflow: hidden;
        }
       
        .page-container
        {
            -webkit-transition: padding 0.2s ease-in;
            transition: padding 0.2s ease-in;
            padding: 80px;
        }
        .page-container.opened
        {
            padding: 0;
        }
        .page-container.opened .flex-container .country:not(.active)
        {
            opacity: 0;
            -webkit-flex: 0;
            -ms-flex: 0;
            flex: 0;
        }
        .page-container.opened .flex-container .country:not(.active) div
        {
            opacity: 0;
        }
        .page-container.opened .flex-container .active:after
        {
            -webkit-filter: grayscale(0%) !important;
            filter: grayscale(0%) !important;
        }
       
        .flex-container
        {
            display: -webkit-flex;
            display: -ms-flexbox;
            display: flex;
            height: 100%;
        }
        @media all and (max-width: 900px)
        {
            .flex-container
            {
                -webkit-flex-direction: column;
                -ms-flex-direction: column;
                flex-direction: column;
            }
        }
       
        .country
        {
            position: relative;
            -webkit-flex-grow: 1;
            -ms-flex-positive: 1;
            flex-grow: 1;
            -webkit-flex: 1;
            -ms-flex: 1;
            flex: 1;
            -webkit-transition: 0.5s ease-in-out;
            transition: 0.5s ease-in-out;
            cursor: pointer;
            font-family: "Bree Serif" , serif;
            text-align: center;
            color: #fff;
            font-size: 22px;
            text-shadow: 0 0 3px #000;
        }
        .country div
        {
            position: absolute;
            width: 100%;
            z-index: 10;
            top: 50%;
            text-align: center;
            -webkit-transition: 0.1s;
            transition: 0.1s;
            -webkit-transform: translateY(-50%);
            -ms-transform: translateY(-50%);
            transform: translateY(-50%);
            -webkit-filter: none;
            filter: none;
        }
        .country:after
        {
            content: " ";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-size: cover;
            -webkit-transition: 0.5s ease-in-out;
            transition: 0.5s ease-in-out;
            -webkit-filter: grayscale(100%);
            filter: grayscale(100%);
        }
        .country:hover
        {
            -webkit-flex-grow: 6;
            -ms-flex-positive: 6;
            flex-grow: 6;
        }
        .country:hover:after
        {
            -webkit-filter: grayscale(0%);
            filter: grayscale(0%);
        }
        @media all and (max-width: 900px)
        {
            .country
            {
                height: auto;
            }
        }
       
        .netherlands:after
        {
            background-image: url("Netherlands.png");
            background-position: center;
        }
       
        .belgium:after
        {
            background-image: url("belgium-307_3.jpg");
            background-position: center;
        }
       
        .france:after
        {
            background-image: url("30.jpg");
            background-position: center;
        }
       
        .germany:after
        {
            background-image: url("vacation.jpg");
            background-position: center;
        }
       
        .england:after
        {
            background-image: url("england.jpg");
            background-position: center;
        }
    </style>
</head>
<body>
    <div class="page-container">
        <div class="flex-container">
            <div class="country netherlands">
                <div>
                    Netherlands</div>
            </div>
            <div class="country belgium">
                <div>
                    Belgium</div>
            </div>
            <div class="country france">
                <div>
                    France</div>
            </div>
            <div class="country germany">
                <div>
                    Germany</div>
            </div>
            <div class="country england">
                <div>
                    England</div>
            </div>
        </div>
    </div>
    <script src='jquery.js'></script>
    <script>
        $('.country').click(function () {
            $(this).toggleClass('active');
            $('.page-container').toggleClass('opened');
        }); //@ sourceURL=pen.js
    </script>
</body>
</html>

完整實例代碼點擊此處本站下載

希望本文所述對大家的jQuery特效設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 恩施市| 固镇县| 札达县| 甘孜| 秦皇岛市| 浦城县| 仪陇县| 梨树县| 盐池县| 邳州市| 阿城市| 高清| 日土县| 宣化县| 伊春市| 建阳市| 沂源县| 谷城县| 通城县| 浮梁县| 昌吉市| 万宁市| 靖江市| 台南县| 长泰县| 汉中市| 泗洪县| 河南省| 延川县| 固阳县| 光山县| 咸宁市| 赫章县| 广南县| 甘谷县| 奉节县| 九台市| 哈巴河县| 灵石县| 赣州市| 图们市|