Lightweight (< 3kb), dependency-free javascript library to dynamically show the number of unread notifications in your webpage title.
Clone or download
Rafael Oshiro
Rafael Oshiro Merge pull request #12 from guinatal/master
{ Gulp } Jasmine and Uglify
Latest commit 21a4c06 Oct 15, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist dist added Sep 29, 2015
examples Display - Set a maximum number of notifications to display Jun 15, 2014
src src FOLDER Sep 29, 2015
test 2 spaces instead of tab Oct 14, 2015
.gitignore gitignore added Sep 29, 2015
LICENSE Initial commit Apr 16, 2014
README.md Update README.md Jun 15, 2014
bower.json Added Bower support May 13, 2014
gulpfile.js gulpfile.js added Sep 29, 2015
package.json tab removed Oct 14, 2015

README.md

Title Notifier js

Lightweight (< 3Kb), dependency-free javascript library to dynamically show the number of unread notifications in your webpage title.

TitleNotifierGif

Usage

Add title_notifier.js to your webpage.

<script src="title_notifier.js"></script>

Setting Notification

In the example below, it sets the number of notifications as 12.

titlenotifier.set(12);

Adding Notifications

Call the following function to add +1 to notifications total.

titlenotifier.add();

Subtracting Notifications

Call the following to subtract 1 from the total notifications.

titlenotifier.sub();

Reset Notifications

Call the following to set notifications to zero and the title to the original version.

titlenotifier.reset();

Get Number of Notifications (NEW)

Call the following to get the current number of notifications

titlenotifier.get();

Set Max Number of Notifications (NEW)

Call the following to set maximum number of notifications to display. Once the maximum number is reached it displays the max number plus a plus sign. If you set the max to 99 and you have 100 notifications, it will show 99+ instead of 100.

titlenotifier.max(99);

Contribute

Contributions are welcome.