jQuery Animated Favicon Notification Plugin - Notify Better

jQuery Animated Favicon Notification Plugin - Notify Better
File Size: 18.3KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Notify Better is a jQuery plugin that allows you to show important information alerts via favicon, browser title and more. Ideal for pending notifications, unread messages, etc. Please note that Notify Better only works with google chrome and firefox.

You might also like:

How to use it:

1. Include latest jQuery javascript libary and jQuery notify better in the head section of your page

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="jquery.notify-better.js"></script>

2. Call the plugin with options

$("#notification").notify_better({
interval: 2000, // Interval between each polling in milliseconds. If you want notification to update faster, lower the number or vice versa. Set to 0/false to execute only once on page load. Default is 5000 (5 seconds)
url: "random_count.html", // The URL to retrieve the notification count.
overrideAjax: false, // Allows you to override the whole ajax call to your notification in case you want to customise it. See more under Further Customization.
updateTitle: false, // Dynamically Add notification count to your website's title
updateFavicon: { // Enable you to show notification on top of your favicon dynamically
id: "favicon",// the ID of your favicon link tag (as shown above)
backgroundColor: "#f1c40f", // Background color of your notification count
textColor: "#6D461D", // Text color of your notification count
location: "full", // Position of your notification count. Can be "full", "ne", "se", "sw", "nw". The default is full.
shape: "square" // Shape of the notification counter. Can be circle or square.
},
done: function() { // A Callback when the function is completed.
alert("done!")
}
});

3. Ajax support

$("#notification").notify_better({
overrideAjax: function() {
$.ajax({
url: "count.html",
}).done(function(data, textStatus, jqXHR) {
titleclear(); // Notify Better default function to clear title 
changeFavicon(data)//Notify Better default function to change favicon dynamically 
...
});
}
});

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