sweetAlert 确认对话框

top.swal({
                        title: "您确定要结束本次试验么?",
                        text: "结束后信息会自动保存, 直接返回到结果页面",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        confirmButtonText: "是的,结束试验",
                        cancelButtonText: "让我再考虑一下…",
                        closeOnConfirm: false,
                        closeOnCancel: false,
                        customClass: "custom_swal"
                    },
                    function (isConfirm) {
                        if(isConfirm){
                            top.swal.close();
            
                        }else{
                            top.swal.close()
                        }
                    });

你可能感兴趣的:(sweetAlert 确认对话框)