Skip to content

Super simple no configuration notification system for jQuery.

License

Notifications You must be signed in to change notification settings

mariuswilms/notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

notify
-- Notifications

Synopsis
--------
A super simple no configuration notification system.

Usage
-----
Messages are generated like shown below. Each message automatically disappears
after 1100ms by default. For messages containing longer text the timeout is
multiplied to giving an extra time (of 1 seconds per 30 characters over the
first 25 characters) for comprehension. The base timeout can be configured
globally or on a per message basis. You can also make a message "sticky"
causing it to "stay" until you click on it.

...
let notify = new Notifiy(document.body);

notify.queueMessage("Hello!");
notify.queueMessage("Hello!", {level: "success"}); // With optional level.
notify.queueMessage("Hello!", {sticky: true});     // Makes the message sticky.
notify.queueMessage("Hello!", {timeout: 4000});    // Control the minimum timeout.
...

Levels are applied as classes to the message. This can be used to mark a
message as success, error, etc and styled accordingly. Sticky messages
- in addition - have the sticky class added to them.

The complete markup with an active message may look like in the example below.

...
<div class="notify">
  <div class=notify__messages">
    <div class=notify__message success">Hello!</div>
  </div>
</div>
...

Queuing
-------
Currently just one message at a time is being shown.

Copyright & License
-------------------
Notify, is Copyright (c) 2012 Marius Wilms if not otherwise
stated. The code is distributed under the terms of the MIT License.
For the full license text see the LICENSE file.

About

Super simple no configuration notification system for jQuery.

Resources

License

Stars

Watchers

Forks

Packages

No packages published