当用户点击esc警报不应该关闭时,他应该点击立即付款按钮进一步移动。
if($unpaid==true){
echo $print = '<script>
function alertOn(){
swal({
title: "No Membership Fees Received",
text: "Please pay membership fees as per your selected package",
type: "warning",
confirmButtonText: "PAY NOW"
},
function(){
window.location.href = "unpaid.php";
});
};
window.onload = alertOn
</script>';
是的,您可以通过将swal
和allowEscapeKey
属性修改为allowOutsideClick
来配置false
函数,如:
swal({
title: 'title',
text: 'your text',
showConfirmButton: true,
allowEscapeKey : false,
allowOutsideClick: false
});
if ($unpaid == true) {
echo $print1 = '<script>
function alertOn(){
swal({
title: "No Membership Fees Received",
text: "Please pay membership fees as per your selected package",
type: "warning",
confirmButtonText: "PAY NOW",
**allowEscapeKey:false**
},
function(){
window.location.href = "unpaid.php";
});
};
window.onload = alertOn;
</script>';
}
我想对于这个版本你可以使用这个:
swal({
title: 'title',
text: 'your text',
button: false,
closeOnClickOutside: false,
closeOnEsc: false
});