layer中iframe弹框内容撑起弹框

  • 由于iframe是异步加载的,因此先打开一个宽度为0的弹框,加载iframe资源,缓存起来,再在打开新的弹窗
layer.open({
                            type: 2,
                            title: false,
                            closeBtn: 0, //不显示关闭按钮
                            shade: [0],
                            area: ['0px', '215px'],
                            offset: 'rb', //右下角弹出
                            content: ['userPopIframe.html', 'no'],
                            success: function (layero, index) {
                                layer.close(index)
                            },
                            end: function () { //此处用于演示
                                layer.open({
                                    type: 2,
                                    offset: 't',
                                    scrollbar: false,
                                    area: ['80%', '100%'],
                                    title: '用户管理',
                                    maxmin: true,
                                    content: ['userPopIframe.html', 'no'],
                                    btn: ['保存', '取消'],
                                    btn1: function () {
                                        layer.closeAll();
                                    },
                                    btn2: function () {
                                        layer.closeAll();
                                    },
                                    btnAlign: 'r',
                                });
                            }
                        })
相关文章
相关标签/搜索