jQuery Bootstrap Alerts v2.0.0
jQuery plugin to programmatically display bootstrap alerts
Installation
Download
- jquery.bsAlert.min.js (1.91kB, 911B gzipped)
- jquery.bsAlert.js (4.01kB, 1.3kB gzipped)
CDN
<!-- OR -->
Package Managers
Install via yarn:
$ yarn add jquery-bsalert
Install via NPM:
$ npm install jquery-bsalert --save
Usage
Standard Usage
Webpack and Browserify
$ yarn add jquery-bsalert
var $ = ;; ;
Options
Option | Type | Description | Default |
---|---|---|---|
type | string |
Alert type. See http://getbootstrap.com/components/#alerts for the different types allowed. | danger |
content | string or function |
The alert's text or html content. Can also be a function, see below for an example.. | '' |
dismissible | boolean |
Whether the alert can be dismissed. Displays a close button if true | false |
position | string or function |
Where to position the alert. Valid options are 'before', 'after', or a function. | before |
Using the position
option as a function:
;
Using the content
option as a function:
;
Modify the $.fn.bsAlert
object to change default option values:
$fnbsAlertdismissible = true;
License
Released under the MIT license