top notification bar topper - Download Lightweight Top Notification Bar Plugin - jQuery Topper.js

Download Lightweight Top Notification Bar Plugin – jQuery Topper.js

Posted on

This time I will share jQuery Plugin and tutorial about Lightweight Top Notification Bar Plugin – jQuery Topper.js, hope it will help you in programming stack.

top notification bar topper - Download Lightweight Top Notification Bar Plugin - jQuery Topper.js
File Size: 7.3 KB
Views Total: 1892
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Topper.js is a minimal clean jQuery notification bar plugin which displays a customizable, dismissable, full-width alert message on the top of the page.

How to use it:

1. Load jQuery library and the Topper.js plugin’s files in the HTML.

1 <link rel="stylesheet" href="src/topper.css">
3         integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
4         crossorigin="anonymous">
5 </script>
6 <script src="src/topper.js"></script>

2. Create a Sticky top notification bar that will always be visible until the user clicks on the close button.

1 Topper({
2   title: 'My Alert',
3   text: 'This is my sample notification.',
4   style: 'danger',
5   type: 'top',
6   autoclose: false
7 });

3. Create a toast-like top notification bar that will automatically dismiss after a timeout you specify.

1 Topper({
2   title: 'My Alert',
3   text: 'This is my sample notification.',
4   style: 'danger',
5   type: 'top',
6   autoclose: true,
7   autocloseAfter: 3000
8 });

4. The plugin currently comes with 4 themes:

  • success
  • info
  • warning
  • danger
1 Topper({
2   title: 'My Alert',
3   text: 'This is my sample notification.',
4   style: 'info',
5   type: 'top',
6   autoclose: false
7 });

5. Create your own theme in the CSS:

1 .topper-custom {
2   /* styles here */
3 }
1 Topper({
2   title: 'My Alert',
3   text: 'This is my sample notification.',
4   style: 'custom',
5   type: 'top',
6   autoclose: false
7 });

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

source : jquery.net