Today I will share with you a very beautiful pop-up layer control: SweetAlert. js
First, let's look at the effect chart:
Success prompt:
Failure prompt:
Confirmation box prompt:
Online demo address:
Usage
Swal ("Here's a message! ")
Parameter details
Default parameter description
Name of the title null (required) window. The object can be passed through the "title" attribute or the first parameter.
Description of the text null window. It can be passed through the "text" attribute of the object or the second parameter.
Type null window type. SweetAlert has four types of icon animations: "warning", "error", "success", and "info". It can be placed in the "type" array or passed through the third parameter.
If allowOutsideClick false is set to "true", you can close the warning box by clicking a region other than the warning box.
ShowCancelButton false if set to "true", the "cancel" button is displayed. Click to close the warning box.
ConfirmButtonText "OK" is used to change the text on the confirmation button. If it is set to "true", the OK button will automatically replace "Confirm" with "OK ".
ConfirmButtonColor "# AEDEF4" this parameter is used to change the background color of the confirmation button (must be a HEX value ).
CancelButtonText "Cancel" is used to change the text of the Cancel button.
CloseOnConfirm true: if you want to click the OK button later, set the modal window to "false" if it is retained ". This parameter is useful when other SweetAlert trigger confirmation button events.
Add a custom image to the warning box in imageUrl null. Must be the complete path of the image.
ImageSize "80x80" after setting the image path, you can set the image size. The format is two digits with an "x" symbol in the middle.
The time when the timer null warning box is automatically disabled. The unit is ms.