Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Super simple no configuration notification system for jQuery.
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README
notify.js

README

notify
-- A jQuery Notification Plugin

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

Features
--------
- No configuration required
- Message-queuing
- Message-flooding prevention
- "Smart" timeout

Usage
-----
As the first and only preparation step you'll have to add a container div to
your document. Once the container is in place the plugin will start appending
a message each time you call notify.

...
<div id="messages"></div>
...

Messages are generated like shown below. Each message automatically disappears
after 2100ms 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. You can also make a message "sticky" to
make it stay until you click it by providing a 3rd parameter.

...
$.notify("Hello!");
$.notify("Hello!", "success"); // With optional level.
$.notify("Hello!", "success", true); // Makes the message sticky.
$.notify("Hello!", "success", false, 4000); // Control the minimum timeout in ms.
...

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 id="messages">
	<div class="message success">Hello!</div>
</div>
...

Queuing
-------
Currently just one message at a time is being shown. Only 2 messages are
actually queued to prevent flooding the notification system. This may lead to
messages being discarded - which is bad. On the other hand it's freeing you
from implementing your own buffering mechanisms - which is good.

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

Versions & Requirements
-----------------------
Notify follows the rolling release development model. Code in the master
branch should always considered to be stable. While code in the dev branch
should be considered unstable or sometimes even expiremental.

There are no versions as in the standard release development model but
snapshots. The master branch may be tagged ("snapshotted") at any point in
time when a significant point of development has been reached.

Snapshots are schemed as follows:
[current year, two digit].[index, zero based]

Requires jquery >= 1.8.1.
Something went wrong with that request. Please try again.