Sweet Alert Message In JavaScript

as-alert-message

AsAlertMessage is a simple, sweet, customizable, animated modal plugin used to replace the default alert / prompt / confirm dialog boxes. AsAlertMessage is independent of jquery

See Demo Here

Usage

<link href="css/as-alert-message.min.css" rel="stylesheet">
<script src="js/as-alert-message.min.js"></script>
//or using cdn
<link href="https://cdn.isfidev.net/asalertmessage/v1.0/css/as-alert-message.min.css" rel="stylesheet">
<script src="https://cdn.isfidev.net/asalertmessage/v1.0/js/as-alert-message.min.js"></script>

Example Code

Create Basic Alert
asAlertMsg("hey test text");
Alert automatically close
asAlertMsg({
  type: "success",
  title: "Title message",
  message: "Text message"
});
Alert with button to close
asAlertMsg({
  type: "success",
  title: "Title message",
  message: "Text message",
  button: {
  	text: "Title Button",
  	bg: "success"
  }
});
//for button
//default {}
//text & bg, is optional
Alert with button to redirect
asAlertMsg({
  type: "success",
  title: "Title message",
  message: "Text message",
  button: {
  	text: "Title Button",
  	bg: "success"
  },
  success: {
	redirect: ["https://google.com"]
  }
});
Alert with automatically redirect
asAlertMsg({
  type: "success",
  title: "Title message",
  message: "Text message",
  timer: 1000,
  success: {
	redirect: ["https://google.com"]
  }
});
//for this timer parameter the optional
//default is 1500
If you want to redirect to a new tab, add “_blank” to the redirect parameter value, like this
redirect: ["https://google.com","_blank"]

Download Details:

Author: ahmadsopyan9

Demo: https://plugin.isfidev.net/asalertmessage/demo.html

Source Code: https://github.com/ahmadsopyan9/as-alert-message

#javascript

Sweet Alert Message In JavaScript
4.25 GEEK