温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

css3和jquery如何实现动画显示弹出层按钮

发布时间:2021-06-25 09:49:13 阅读:102 作者:小新 栏目:web开发
前端开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

这篇文章主要为大家展示了“css3和jquery如何实现动画显示弹出层按钮”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“css3和jquery如何实现动画显示弹出层按钮”这篇文章吧。

效果图如下:

css3和jquery如何实现动画显示弹出层按钮

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板

<div class="papersheet">  
        <!-- Action Trigger -->  
        <div class="papersheet__trigger">  
            <!-- Icon -->  
            <svg class="papersheet__trigger-icon" viewbox="0 0 24 24"><g transform="scale(0.023 0.023)"><path d="M1014.662 822.66c-0.004-0.004-0.008-0.008-0.012-0.010l-310.644-310.65 310.644-310.65c0.004-0.004 0.008-0.006 0.012-0.010 3.344-3.346 5.762-7.254 7.312-11.416 4.246-11.376 1.824-24.682-7.324-33.83l-146.746-146.746c-9.148-9.146-22.45-11.566-33.828-7.32-4.16 1.55-8.070 3.968-11.418 7.31 0 0.004-0.004 0.006-0.008 0.010l-310.648 310.652-310.648-310.65c-0.004-0.004-0.006-0.006-0.010-0.010-3.346-3.342-7.254-5.76-11.414-7.31-11.38-4.248-24.682-1.826-33.83 7.32l-146.748 146.748c-9.148 9.148-11.568 22.452-7.322 33.828 1.552 4.16 3.97 8.072 7.312 11.416 0.004 0.002 0.006 0.006 0.010 0.010l310.65 310.648-310.65 310.652c-0.002 0.004-0.006 0.006-0.008 0.010-3.342 3.346-5.76 7.254-7.314 11.414-4.248 11.376-1.826 24.682 7.322 33.83l146.748 146.746c9.15 9.148 22.452 11.568 33.83 7.322 4.16-1.552 8.070-3.97 11.416-7.312 0.002-0.004 0.006-0.006 0.010-0.010l310.648-310.65 310.648 310.65c0.004 0.002 0.008 0.006 0.012 0.008 3.348 3.344 7.254 5.762 11.414 7.314 11.378 4.246 24.684 1.826 33.828-7.322l146.746-146.748c9.148-9.148 11.57-22.454 7.324-33.83-1.552-4.16-3.97-8.068-7.314-11.414z"></path></g></svg>  
        </div>  
        <!-- Face 1 -->  
        <div class="papersheet__face-item animated fadeInUp">  
            <img src="128.jpg" alt="" />  
        </div>  
        <!-- Face 2 -->  
        <div class="papersheet__face-item animated fadeInUp">  
            <img src="129.jpg" alt="" />  
        </div>  
        <!-- Face 2 -->  
        <div class="papersheet__face-item animated fadeInUp">  
            <img src="130.jpg" alt="" />  
        </div>  
    </div>  
    <script src='jquery.js'></script>  
    <script>  
        _papersheet = $('.papersheet');   
        _trigger = $('.papersheet__trigger');   
        _trigger.click(function () {   
            if (_papersheet.hasClass('opened')) {   
                $(this).parent('.papersheet').stop().removeClass('opened');   
            } else {   
                $(this).parent('.papersheet').stop().addClass('opened');   
            }   
        });   
        //@ sourceURL=pen.js   
    </script>

  css3代码:

CSS Code复制内容到剪贴板

@import url("http://daneden.github.io/animate.css/animate.min.css");   
        :root   
        {   
            width100%;   
            height100%;   
        }   
        body   
        {   
            width100%;   
            height100%;   
            display: -webkit-flex;   
            display: -ms-flexbox;   
            display: flex;   
            -webkit-align-items: center;   
            -ms-flex-align: center;   
            align-items: center;   
            -webkit-justify-content: center;   
            -ms-flex-pack: center;   
            justify-content: center;   
            overflow: hidden;   
            background-color#263238;   
        }   
        .papersheet   
        {   
            position: relative;   
            overflow: hidden;   
            text-align: center;   
            -moz-box-sizing: border-box;   
            box-sizing: border-box;   
            -webkit-transition: all 200ms;   
            transition: all 200ms;   
            width100%;   
            height100%;   
            max-width50%;   
            min-width50rem;   
            max-height50%;   
            min-height20rem;   
            margin0 auto;   
            display: -webkit-flex;   
            display: -ms-flexbox;   
            display: flex;   
            -webkit-align-items: center;   
            -ms-flex-align: center;   
            align-items: center;   
            -webkit-justify-content: center;   
            -ms-flex-pack: center;   
            justify-content: center;   
        }   
        .papersheet.opened   
        {   
            -webkit-transition: all 900ms;   
            transition: all 900ms;   
            box-shadow0px 5px 20px rgba(0000.5);   
        }   
        .papersheet__trigger   
        {   
            z-index1;   
            display: inline-block;   
            padding2rem;   
            border-radius50%;   
            position: absolute;   
            background-color: transparent;   
            top50%;   
            left50%;   
            -webkit-transformtranslate(-50%, -50%);   
            -ms-transformtranslate(-50%, -50%);   
            transformtranslate(-50%, -50%);   
            -webkit-transition: all 800ms cubic-bezier(0.1910.221);   
            transition: all 800ms cubic-bezier(0.1910.221);   
            cursor: pointer;   
        }   
        .opened .papersheet__trigger   
        {   
            background-color#eceff1;   
            top10%;   
        }   
        .papersheet__trigger:hover   
        {   
            box-shadow0px 5px 20px rgba(0000.5);   
        }   
        .papersheet__trigger:active:before   
        {   
            background-color#d5d5d5;   
        }   
        .papersheet__trigger:before   
        {   
            content"";   
            background-color#eceff1;   
            display: block;   
            position: absolute;   
            border-radius50%;   
            top50%;   
            left50%;   
            bottombottom: 50%;   
            rightright: 50%;   
            width6rem;   
            height6rem;   
            z-index0;   
            pointer-events: none;   
            -webkit-transformtranslate(-50%, -50%);   
            -ms-transformtranslate(-50%, -50%);   
            transformtranslate(-50%, -50%);   
            -webkit-transition-delay2s;   
            transition-delay2s;   
            -webkit-transition: all 400ms cubic-bezier(0.1650.840.441);   
            transition: all 400ms cubic-bezier(0.1650.840.441);   
        }   
        .opened .papersheet__trigger:before   
        {   
            width3000px;   
            height3000px;   
            -webkit-transition: all 2.5s cubic-bezier(0.1650.840.441);   
            transition: all 2.5s cubic-bezier(0.1650.840.441);   
        }   
        .papersheet__trigger-icon  
        {   
            fill: #37474f;   
            vertical-align: bottombottom;   
            -webkit-transformrotate(45deg);   
            -ms-transformrotate(45deg);   
            transformrotate(45deg);   
            -webkit-transition: all 800ms cubic-bezier(0.1910.221);   
            transition: all 800ms cubic-bezier(0.1910.221);   
            -webkit-transition-delay50ms;   
            transition-delay50ms;   
            width1.8rem;   
            height1.8rem;   
        }   
        .opened .papersheet__trigger-icon  
        {   
            -webkit-transformrotate(-360deg);   
            -ms-transformrotate(-360deg);   
            transformrotate(-360deg);   
        }   
        .papersheet__face-item   
        {   
            border-radius50%;   
            margin0 1.5rem;   
            z-index1;   
            height6rem;   
            width6rem;   
            display: none;   
            overflow: hidden;   
        }   
        .papersheet__face-item:nth-child(2)   
        {   
            -webkit-animation-delay50ms;   
            animation-delay50ms;   
        }   
        .papersheet__face-item:nth-child(3)   
        {   
            -webkit-animation-delay150ms;   
            animation-delay150ms;   
        }   
        .papersheet__face-item:nth-child(4)   
        {   
            -webkit-animation-delay250ms;   
            animation-delay250ms;   
        }   
        .papersheet__face-item img   
        {   
            max-width100%;   
        }   
        .opened .papersheet__face-item   
        {   
            -webkit-transformtranslateX(60%);   
            -ms-transformtranslateX(60%);   
            transformtranslateX(60%);   
            display: block;   
        }

以上是“css3和jquery如何实现动画显示弹出层按钮”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

原文链接:https://www.jb51.net/css/269616.html

AI

开发者交流群×