jquery制作漂亮的弹出层提示消息特效

日期:2019-09-07编辑作者:关于计算机

前几日给大家带来一款基于jquery超炫的弹出层提示消息。那款实例页面开端时,多少个go开关。当单击go按键时,提醒强出层以动画情势现身。效果图如下:

jquery制作地道的弹出层提醒新闻特效,jquery特效

明天给大家带来一款基于jquery超炫的弹出层提醒音信。那款实例页面伊始时,一个go开关。当单击go按键时,提醒强出层以卡通方式出现。效果图如下:

图片 1

福寿绵绵的代码。

html代码:

复制代码 代码如下:

  <div class='b'>
    </div>
    <div class='bb'>
    </div>
    <button id='go'>
        GO
    </button>
    <div class='message'>
        <div class='check'>
            ✔
        </div>
        <p>
            Success
        </p>
        <p>
            Check your email for a booking confirmation. We'll see you soon!
        </p>
        <button id='ok'>
            OK
        </button>
    </div>
    <script src='jquery.js'></script>
    <script>
        $('#go').click(function () {
            go(50);
        });
        $('#ok').click(function () {
            go(500);
        });
        setTimeout(function () {
            go(50);
        }, 700);
        setTimeout(function () {
            go(500);
        }, 2000);
        function go(nr) {
            $('.bb').fadeToggle(200);
            $('.message').toggleClass('comein');
            $('.check').toggleClass('scaledown');
            $('#go').fadeToggle(nr);
        }
        //@ sourceURL=pen.js
    </script>

css代码:

复制代码 代码如下:

  body, html
        {
            height: 100%;
            font-size: 20px;
            font-family: Source Sans Pro;
        }
        .b, .bb
        {
            position: absolute;
            width: 100%;
            height: 100%;
            background: url("kje4L5j.jpg");
            background-attachment: fixed;
            background-size: cover;
            background-position: center;
        }
        .bb
        {
            background: url("bDBs0et.jpg");
            background-attachment: fixed;
            background-size: cover;
            background-position: center;
            display: none;
        }
        #go
        {
            position: absolute;
            top: 30px;
            left: 50%;
            transform: translate(-50%, 0%);
            color: white;
            border: 0;
            background: #71c341;
            width: 100px;
            height: 30px;
            border-radius: 6px;
            font-size: 1rem;
            transition: background 0.2s ease;
            outline: none;
        }
        #go:hover
        {
            background: #8ecf68;
        }
        #go:active
        {
            background: #5a9f32;
        }
        .message
        {
            position: absolute;
            top: -200px;
            left: 50%;
            transform: translate(-50%, 0%);
            width: 300px;
            background: white;
            border-radius: 8px;
            padding: 30px;
            text-align: center;
            font-weight: 300;
            color: #2c2928;
            opacity: 0;
            transition: top 0.3s cubic-bezier(0.31, 0.25, 0.5, 1.5), opacity 0.2s ease-in-out;
        }
        .message .check
        {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translate(-50%, -50%) scale(4);
            width: 120px;
            height: 110px;
            background: #71c341;
            color: white;
            font-size: 3.8rem;
            padding-top: 10px;
            border-radius: 50%;
            opacity: 0;
            transition: transform 0.2s 0.25s cubic-bezier(0.31, 0.25, 0.5, 1.5), opacity 0.1s 0.25s ease-in-out;
        }
        .message .scaledown
        {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
        }
        .message p
        {
            font-size: 1.1rem;
            margin: 25px 0px;
            padding: 0;
        }
        .message p:nth-child(2)
        {
            font-size: 2.3rem;
            margin: 40px 0px 0px 0px;
        }
        .message #ok
        {
            position: relative;
            color: white;
            border: 0;
            background: #71c341;
            width: 100%;
            height: 50px;
            border-radius: 6px;
            font-size: 1.2rem;
            transition: background 0.2s ease;
            outline: none;
        }
        .message #ok:hover
        {
            background: #8ecf68;
        }
        .message #ok:active
        {
            background: #5a9f32;
        }
        .comein
        {
            top: 150px;
            opacity: 1;
        }

上述正是基于jQuery制作的优质的弹出层提示特效的整套代码了,特其他理想呢,小同伙们方可一贯动用到和谐的品类中去。

明日给我们带来一款基于jquery超炫的弹出层提醒新闻。那款实例页面起始时,叁个go开关。...

图片 2

贯彻的代码。

html代码:

复制代码 代码如下:

  <div class='b'>
    </div>
    <div class='bb'>
    </div>
    <button id='go'>
        GO
    </button>
    <div class='message'>
        <div class='check'>
            ✔
        </div>
        <p>
            Success
        </p>
        <p>
            Check your email for a booking confirmation. We'll see you soon!
        </p>
        <button id='ok'>
            OK
        </button>
    </div>
    <script src='jquery.js'></script>
    <script>
        $('#go').click(function () {
            go(50);
        });
        $('#ok').click(function () {
            go(500);
        });
        setTimeout(function () {
            go(50);
        }, 700);
        setTimeout(function () {
            go(500);
        }, 2000);
        function go(nr) {
            $('.bb').fadeToggle(200);
            $('.message').toggleClass('comein');
            $('.check').toggleClass('scaledown');
            $('#go').fadeToggle(nr);
        }
        //@ sourceURL=pen.js
    </script>

css代码:

复制代码 代码如下:

  body, html
        {
            height: 100%;
            font-size: 20px;
            font-family: Source Sans Pro;
        }
        .b, .bb
        {
            position: absolute;
            width: 100%;
            height: 100%;
            background: url("kje4L5j.jpg");
            background-attachment: fixed;
            background-size: cover;
            background-position: center;
        }
        .bb
        {
            background: url("bDBs0et.jpg");
            background-attachment: fixed;
            background-size: cover;
            background-position: center;
            display: none;
        }
        #go
        {
            position: absolute;
            top: 30px;
            left: 50%;
            transform: translate(-50%, 0%);
            color: white;
            border: 0;
            background: #71c341;
            width: 100px;
            height: 30px;
            border-radius: 6px;
            font-size: 1rem;
            transition: background 0.2s ease;
            outline: none;
        }
        #go:hover
        {
            background: #8ecf68;
        }
        #go:active
        {
            background: #5a9f32;
        }
        .message
        {
            position: absolute;
            top: -200px;
            left: 50%;
            transform: translate(-50%, 0%);
            width: 300px;
            background: white;
            border-radius: 8px;
            padding: 30px;
            text-align: center;
            font-weight: 300;
            color: #2c2928;
            opacity: 0;
            transition: top 0.3s cubic-bezier(0.31, 0.25, 0.5, 1.5), opacity 0.2s ease-in-out;
        }
        .message .check
        {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translate(-50%, -50%) scale(4);
            width: 120px;
            height: 110px;
            background: #71c341;
            color: white;
            font-size: 3.8rem;
            padding-top: 10px;
            border-radius: 50%;
            opacity: 0;
            transition: transform 0.2s 0.25s cubic-bezier(0.31, 0.25, 0.5, 1.5), opacity 0.1s 0.25s ease-in-out;
        }
        .message .scaledown
        {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
        }
        .message p
        {
            font-size: 1.1rem;
            margin: 25px 0px;
            padding: 0;
        }
        .message p:nth-child(2)
        {
            font-size: 2.3rem;
            margin: 40px 0px 0px 0px;
        }
        .message #ok
        {
            position: relative;
            color: white;
            border: 0;
            background: #71c341;
            width: 100%;
            height: 50px;
            border-radius: 6px;
            font-size: 1.2rem;
            transition: background 0.2s ease;
            outline: none;
        }
        .message #ok:hover
        {
            background: #8ecf68;
        }
        .message #ok:active
        {
            background: #5a9f32;
        }
        .comein
        {
            top: 150px;
            opacity: 1;
        }

上述即是基于jQuery制作的非凡的弹出层提示特效的成套代码了,特别的赏心悦目啊,小同伴们方可一向使用到本人的类型中去。

您只怕感兴趣的篇章:

  • jquery轻松的弹出层浮动层代码
  • jQuery弹出层插件Lightbox_me使用指南
  • jQuery+html5落到实处div弹出层并遮罩背景
  • 原创jQuery弹出层插件分享
  • jQuery点缩略图弹出层展现大图片
  • Jquery 实现弹出层插件
  • jquery完结可拖拽弹出层特效
  • JQuery弹出层示例可自定义
  • jquery落成弹出层效果实例

本文由今晚最快开奖现场直播发布于关于计算机,转载请注明出处:jquery制作漂亮的弹出层提示消息特效

关键词:

方法用法实例

本文实例讲述了jQuery中hide()方法用法。分享给大家供大家参考。具体分析如下: jQuery中hide()方法用法实例,jqueryhid...

详细>>

浅析Javascript中“==”与“===”的分别

以前使用JavaScript的时候,时一时的会遇到使用 == 和 ===那多少个暗记来判别多个变量是或不是等于。但是对于那八个...

详细>>

主意用法实例

本文实例讲述了jQuery中width()方法用法。分享给大家供大家参考。具体分析如下: 本文实例讲述了jQuery中html()方法用法...

详细>>

JavaScript中自定义事件用法剖析

本文实例讲述了JavaScript中自定义事件用法。分享给大家供大家参考。具体分析如下: JavaScript中自定义事件用法分析...

详细>>