Create Alert Notifications Using Bootstrap Alerts - BootsAlert

Create Alert Notifications Using Bootstrap Alerts - BootsAlert
File Size: 5.57 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

BootsAlert is a lightweight jQuery plugin which lets you create customizable alert notifications using Bootstrap alerts component.

Supports both Bootstrap 4 and Bootstrap 3.

How to use it:

1. Include jQuery and Bootstrap 4 (or Bootstrap 3) framework on the webpage.

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

2. Download and include the jQuery BootsAlert plugin after jQuery.

<script src="bootsalert.min.js"></script>

3. Create a container in which you want to place the notification.

<div id="demo"></div>

4. Generate a custom alert notification inside the container. All possible parameters:

  • className: Bootstrap alert class, like success, info, ..., or use your own custom class
  • message: Message that will displayed to user
  • container: Alert will be inserted to this container. Must have an unique id.
  • closebtn: If true, alert will have a close button.
  • append: Bootsalert can be appended with several alert elements.
bootsalert({
  className: "success",
  message: "Alert Message",
  container: "demo",
  closebtn: true
});

This awesome jQuery plugin is developed by dhanyn10. For more Advanced Usages, please check the demo page or visit the official website.