A full featured, lightweight javascript browser alert display library.
A full featured, lightweight javascript browser alert display library. These browser alerts / notifications are fully customizable on a global or on a per notification basis.
Downloading and using tellme.js is a charm. Simply visit https://github.com/shaktiphartiyal/tellmejs and click Clone or Download, click on Download Zip. Extract the tellme.min.js and tellme.min.css and copy to your project folder.
Include into the <head> section of your web page the extracted files like:
<link rel="stylesheet" href="tellme.min.css" type="text/css">
<script src="tellme.min.js" type="text/javascript"></script>
That’s all you need to start using tellme.js
Four types of alerts are available in tellme.js:
tellme.success(message,options);
Error Alerttellme.error(message,options);
Informative Alerttellme.info(message,options);
Warning Alerttellme.warn(message,options);
You can configure tellme.js alerts globally or on a per alert basis.
You can globally configure tellme.js for the page by using the following function before calling any alert of tellme.js.
tellme.config(configObject);
You can set configurationof every tellme.js alert using the second parameter(options) of the alert call like the example given below:
tellme.error(message,configObject);
errorClass: "tm_alert-danger",
successClass: "tm_alert-success",
infoClass: "tm_alert-info",
warnClass: "tm_alert-warn",
errorSymbol: "tm_tm-error",
successSymbol: "tm_tm-success",
infoSymbol: "tm_tm-info",
warnSymbol: "tm_tm-warn",
errorDisplayTimeout:5,
successDisplayTimeout:5,
infoDisplayTimeout:5,
warnDisplayTimeout:5,
alertClass:"tm_alertMsg",
subAlertClass:"tm_alert",
progressClass:"tm_alert_progress",
position:"top-right",
open:function(){},
close:function(){}
passing these options in alert calls:
tellme.config({
errorClass: "tm_alert-danger",
successClass: "tm_alert-success",
infoClass: "tm_alert-info",
warnClass: "tm_alert-warn",
errorSymbol: "tm_tm-error",
successSymbol: "tm_tm-success",
infoSymbol: "tm_tm-info",
warnSymbol: "tm_tm-warn",
errorDisplayTimeout:5,
successDisplayTimeout:5,
infoDisplayTimeout:5,
warnDisplayTimeout:5,
alertClass:"tm_alertMsg",
subAlertClass:"tm_alert",
progressClass:"tm_alert_progress",
position:"top-right",
open:function(){},
close:function(){}
});
-----------------OR----------------------
tellme.error("An error occured",{
errorClass: "tm_alert-danger",
successClass: "tm_alert-success",
infoClass: "tm_alert-info",
warnClass: "tm_alert-warn",
errorSymbol: "tm_tm-error",
successSymbol: "tm_tm-success",
infoSymbol: "tm_tm-info",
warnSymbol: "tm_tm-warn",
errorDisplayTimeout:5,
successDisplayTimeout:5,
infoDisplayTimeout:5,
warnDisplayTimeout:5,
alertClass:"tm_alertMsg",
subAlertClass:"tm_alert",
progressClass:"tm_alert_progress",
position:"top-right",
open:function(){},
close:function(){}
});
tellme.info("Welcome to tellme.js, it's good to see you here !",{
infoDisplayTimeout:2,
position:"top-center",
open:function(){
//something you want to do when the alert opens
}
});
tellme.info("Welcome to tellme.js, it's good to see you here !",{
infoDisplayTimeout:2,
position:"top-center",
close:function(){
//something you want to do when the alert closes
}
});
document.addEventListener('tellmeStart', function(e){
console.info(e); //or do something useful here
}, false);
The closed event listener:
document.addEventListener('tellmeClosed', function(e){
console.info(e); //or do something useful here
}, false);
More information on eventListener can be found here: