Prevent SweetAlert to be closed on clicking outside the popup window

前端 未结 13 1100
不知归路
不知归路 2021-02-01 04:40

I am using Sweet Alert for a popup on my product view in an E-commerce Application with two buttons: one for going on cart View and another for reloading the vi

13条回答
  •  情书的邮戳
    2021-02-01 05:01

    It is allowOutsideClick: false for example

    swal({
      title: "View Cart",
      text: "Are you sure?",
      type: "warning",
      showCancelButton    : true,
      confirmButtonColor  : "#ff0000",
      confirmButtonText   : "Yes",
      allowOutsideClick: false,
      CancelButtonText    : "No"
                },
                    function() //confirm
                {
                    //if Yes do this
                }
    );
    

提交回复
热议问题