评论:SweetAlert2强大的纯Js模态消息对话框插件  [查看原文]

所属分类:UI-对话框,工具提示

 96059  454  38
当前第1页 / 共2页
    Kitty.のバガ0
    2021/3/18 15:04:23

    图片大小调整 不了啊。几个方法没有用

    swal({
            title: "识别二维码关注公众号后",
            allowOutsideClick: false,
            allowEscapeKey: false,
            confirmButtonText: "我已关注",
            imageUrl: "https://www.XXXXXXXX.com/uploadfile/qrcode/qxrxqrcode.jpg",
            imageWidth: "500px",
            imageHeight: "1000px",
            imageClass: "sweetAlertImage"
        },
        function() {});
    回复
    mlrhmj0
    2021/1/23 14:50:55
    不是居中对齐 菜鸟 还是找了别的版本 回复
    预&逝去0
    2019/9/19 10:46:18
    sweetalert2.all.js:2851 Uncaught TypeError: Cannot read property 'constructor' of undefined
    一直提示这个是怎么回事
        预&逝去0
        2019/9/19 10:51:05
        swal.fire({
            title: "站点编号错误",
            text: "未找到编号站点,请确认后重试",
            type: 'error',
            timer: 2000,
            buttons: false,
            showConfirmButton: false,
        });

        加个fire就可以了。这是必须加的吗?我是菜鸟。求大神

    回复
    昵称不再换啦0
    2019/7/19 9:04:31
    去属于0
    2019/3/8 11:08:48
    请问一下,ajax怎么加里面呢? 回复
    安然。0
    2018/9/4 16:45:44
    这个 sweetalert2 的窗体宽高怎么设置 我的为什么会是全屏
        去属于0
        2019/3/8 11:09:51
        在css里有width和height属性吧
    回复
    思念,流年0
    2018/8/16 9:22:16
    字体好大,能设置字体大小吗
        .1
        2019/3/12 17:25:12
        可以的,它的标题是用的h2标签包裹的。你在sweetalert2.min.css里面去修改你想要的大小。
    回复
    2yang丶0
    2018/7/26 17:54:03
    无论点确定还是取消都执行不了后面的方法,怎么回事
        愤怒~mg天空1
        2018/10/25 18:20:29

        在控制台你会发现isconfirm是一个对象且属性为value。包括你点击取消后返回的对象是dismiss而不是isconfirm。比着猜想问题是什么控制台是一个很好发现问题的方法,多思考就行。希望能帮到你

        if (isConfirm.value === true) {
            swal(
                'd!',
                'Your imaginary file has been d.',
                'success'
            );
        
        } else {
            swal(
                'Cancelled',
                'Your imaginary file is safe :)',
                'error'
            );
        }
        愤怒~mg天空1
        2018/10/25 18:25:46
        我纠正一点dismiss是属性else if(isConfirm.dismiss==='cancel')
    回复
    H【?_?】#1
    2018/5/28 15:10:47
    修复第一次打开不居中问题
    1.修改 sweetalert2.js 里面的 getTopMargin() 方法
    2.将:var height = elem.clientHeight;
    3.改成:var height = elem;
        JQLover0
        2018/7/20 10:09:44
        感谢~
    回复
    Tempest_0
    2018/4/18 17:36:53
    包里只有es6-promise.min.js文件没有promise.min.js文件 ; 已经引用了es6-promise.min.js; 在ie11中还是样式是错乱的。插件的压面直接在ie11中打开也是错乱的。大姐有没有解决办法?
        ∑Hello0
        2019/4/30 15:58:42
        <!-- Include a polyfill for ES6 Promises (optional) for IE11 -->
        ‘’<s c r i p t src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.js"></script>‘’
    回复
    七仔0
    2018/1/7 20:36:59

    按确定后怎么不能添加事件求解

    回复
    ??の繁星0
    2017/10/15 18:36:38

    发现一个小问题哎:如果对话框第一次被显示,它会比较靠上。第二次开始则会恢复正常,希望确认一下。

    回复
    ada0030
    2017/6/12 17:28:26

    作者你好,有确定和取消的那个弹窗,为什么点取消会报错,打印了下isConfirm,点击取消并没有返回false

        ada0031
        2017/6/14 14:54:53

        这个问题解决了,你上面的最后一个例子是错误的,会报错。应该是下面这种

        swal({
            title: 'Are you sure?',
            text: 'You will not be able to recover this imaginary file!',
            type: 'warning',
            showCancelButton: true,
            confirmButtonText: 'Yes, delete it!',
            cancelButtonText: 'No, keep it'
        }).then(function() {
            swal('Deleted!', 'Your imaginary file has been deleted.', 'success')
        }, function(dismiss) { // dismiss can be 'overlay', 'cancel', 'close', 'esc', 'timer'  
            if (dismiss === 'cancel') {
                swal('Cancelled', 'Your imaginary file is safe :)', 'error')
            }
        })
    回复
    一米※?捷※0
    2017/5/4 13:56:50

    steps操作 只有下一步下一步,要是能有进入下一步验证和可以返回上一步就很完美了,期待演示

    回复
    被折叠的记忆0
    2017/4/27 17:40:25

    我把你的index文件在IE11上面打开,就不兼容呀.

    回复

讨论这个项目(38)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

取消回复