snackbar alert box - Free Download Simple Snackbar Style Alert Box Plugin For jQuery

Free Download Simple Snackbar Style Alert Box Plugin For jQuery

Posted on

This time I will share jQuery Plugin and tutorial about Simple Snackbar Style Alert Box Plugin For jQuery, hope it will help you in programming stack.

snackbar alert box - Free Download Simple Snackbar Style Alert Box Plugin For jQuery
File Size: 4.51 KB
Views Total: 229
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A simple and mobile-friendly jQuery notification plugin to create customizable, CSS animated notification boxes inspired by Material Design Snackbars.

How to use it:

1. Insert the jQuery Simple Alert Plugin’s JavaScript and CSS files into the web page.

1 <link rel="stylesheet" href="/path/to/src/jquery-simple_alert.css" />
2 <script src="/path/to/cdn/jquery.min.js"></script>
3 <script src="/path/to/src/jquery-simple_alert.js"></script>

2. Display a basic snackbar notification on the screen.

1 simpleAlert({
2   text: 'This is a snackbar style notification'
3 })

3. Determine the position of the notification box.

  • bl: Bottom Left
  • br: Bottom Right (Default)
  • tl: Top Left
  • tr: Top Right
1 simpleAlert({
2   text: 'This is a snackbar style notification',
3   orientation:'tl'
4 })

4. Customize the text and background colors.

1 simpleAlert({
2   text: 'This is a snackbar style notification',
3   bg_color: '#222',
4   text_color: '#fff'
5 })

5. Trigger a function when you click the ‘Okay’ button.

1 simpleAlert({
2   text: 'This is a snackbar style notification',
3   after_alert: function () {
4     alert('Callback');
5   }
6 })

6. Override the default styles & CSS3 animations in the CSS.

01 .simple_alert_div {
02   position: fixed;
03   background-color: green;
04   opacity: 1;
05   z-index: 1;
06   color: white;
07   padding: 8px;
08   transition: all .1s ease;
09   transition-property: top, right, bottom, left, opacity;
10   font-family: Roboto, sans-serif;
11   font-size: 14px;
12   min-height: 14px;
13   display: flex;
14   justify-content: space-between;
15   align-items: center;
16   color: #fff;
17   /* margin: 0 0 0 24px; */
18   line-height: 22px;
19   padding: 10px 10px;
20   z-index: 9999;
21   border-radius: 2px;
22 }