如何在同一个页面打开两个华丽的弹窗?

问题描述 投票:0回答:0

我有两个弹出模式,一个用于查询,另一个用于时事通讯订阅。让时事通讯订阅表格出现在查询表格弹出表格之后。

我为时事通讯设置了超时时间,所以它会在一段时间后加载。然后查询表单在页面加载时使用动画显示弹出窗口。

新闻信弹出代码

setTimeout(function() {
        $.magnificPopup.open({
            items: {
                src: '#newsletter-dialog',
                type:'inline'
            },
            fixedContentPos: true,
            callbacks: {
                open: function () {
                    var html = "<button title='Close (Esc)' type='button' class='mfp-close'></button>";
                    $('.newsletter-dialog').append(html);
                }
            },
            modal: true
        });
    }, 10000);

查询表单弹出代码

  $.magnificPopup.open({
        items: {
            src: '#enquiry-form',
            type:'inline'
        },
        fixedContentPos: true,
        showCloseBtn:true,
        closeBtnInside:true,
        preloader: true,
        midClick: true,
        removalDelay: 300,
        closeMarkup: '<button title="%title%" type="button" class="mfp-close"></button>',
        modal: true
    });


错误:

  1. 当时事通讯弹出窗口打开时,它会关闭查询弹出窗口
  2. 关闭按钮未合并到两个弹出窗口
jquery jquery-ui jquery-plugins magnific-popup mfp
© www.soinside.com 2019 - 2024. All rights reserved.