Minimal Sliding Notification Plugin - jQuery miniNotif

Minimal Sliding Notification Plugin - jQuery miniNotif
File Size: 3.53 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

miniNotif is an extremely lightweight (1kb) jQuery plugin for creating sliding, non-blocking notification messages with custom text, colors and icons.

How to use it:

1. Import the style sheet miniNotif.css for the basic styling of the notifications.

<link href="miniNotif.css" rel="stylesheet">

2. Import jQuery library and the JavaScript file miniNotif.js into the document.

<script src="https://code.jquery.com/jquery-3.2.1.min.js" 
        integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" 
        crossorigin="anonymous">
</script>
<script src="miniNotif.js"></script>

3. Initialize the miniNotif plugin and we're ready to go.

miniNotif.init();

4. The JavaScript (jQuery script) to display a notification on the webpage. Possible parameters:

  • proccessOrNot: 1 = auto dismiss; 0 = permanent
  • text: Notification message text
  • icon: Notification icon
  • fontcolor: Font color
// miniNotif.addNotif(proccessOrNot, text, icon, fontcolor);
miniNotif.addNotif(1, 'This is a notification message', '!!!', '#222');

5. Override the default styles of the notification messages as per your needs:

#miniNotif .miniNotif {
  background-color : #f1f1f1;
  padding: 10px 20px;
  -moz-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  -webkit-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  -o-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  filter:progid:DXImageTransform.Microsoft.Shadow(color=#rgba(0, 0, 0, 0.1), Direction=180, Strength=2);
  position: relative;
  max-width: 220px;
  font-size: 18px;
}

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