$.cosyAlert.configuration
Var | Value |
---|---|
defaultType
|
string, default: 'alert'
The default type for alerts. |
useQueue
|
boolean, default: false
Enable/disable the queue |
$.cosyAlert.configurationAlert
Var | Value |
---|---|
container
|
null |
vPos
|
'top' |
hPos
|
'center' |
autoHide
|
true |
autoHideTime
|
4000 |
showTime
|
400 |
hideTime
|
600 |
onShowComplete
|
null |
onHideComplete
|
null |
cosyAlert('I\'m a default alert...');
cosyAlert('I\'m a default error alert', 'error');
Chained alerts using callback function
cosyAlert('If at first you don\'t succeed...', 'notice', function(){ cosyAlert('Try try try and try again ;-)', 'success'); });
cosyAlert('<strong>Sticky</strong><br />I\'m not gonna hide myself, make me !', 'notice', { autoHide : false });
cosyAlert('<strong>Slow show and hide</strong><br />I\'m old, I don\'t move so fast...', 'notice', { showTime : 1000, hideTime : 1000 });
cosyAlert('<strong>I\'m special ! :-D</strong><br />Hey look a me (you have to close me)', 'notice', { vPos : 'top', hPos : 'right', autoHide : false, showTime : 300, hideTime : 750 });
var options = {
container : 'place-for-mr-special',
vPos : 'middle',
hPos : 'center',
autoHide : true,
autoHideTime : 7000,
showTime : 1000,
hideTime : 1000,
onShowComplete : function(){
cosyAlert('Mr. Special is now shown', { autoHideTime : 2000 });
},
onHideComplete : function(){
cosyAlert('Mr. Special is now hidden', { autoHideTime : 2000 });
}
};
cosyAlert('<strong>Mr. Special</strong><br />I\'m feed so... <em>customized</em>', 'notice', options);
Queue ()
$.cosyAlert.configuration.useQueue = true;
$.cosyAlert.configuration.useQueue = false;
Positions
cosyAlert('top left', { vPos : 'top', hPos : 'left' });
cosyAlert('top center', { vPos : 'top', hPos : 'center' });
cosyAlert('top right', { vPos : 'top', hPos : 'right' });
cosyAlert('middle left', { vPos : 'middle', hPos : 'left' });
cosyAlert('middle center', { vPos : 'middle', hPos : 'center' });
cosyAlert('middle right', { vPos : 'middle', hPos : 'right' });
cosyAlert('bottom left', { vPos : 'bottom', hPos : 'left' });
cosyAlert('bottom center', { vPos : 'bottom', hPos : 'center' });
cosyAlert('bottom right', { vPos : 'bottom', hPos : 'right' });
cosyAlert('top left', { vPos : 'top', hPos : 'left' });
cosyAlert('top center', { vPos : 'top', hPos : 'center' });
cosyAlert('top right', { vPos : 'top', hPos : 'right' });
cosyAlert('middle left', { vPos : 'middle', hPos : 'left' });
cosyAlert('middle center', { vPos : 'middle', hPos : 'center' });
cosyAlert('middle right', { vPos : 'middle', hPos : 'right' });
cosyAlert('bottom left', { vPos : 'bottom', hPos : 'left' });
cosyAlert('bottom center', { vPos : 'bottom', hPos : 'center' });
cosyAlert('bottom right', { vPos : 'bottom', hPos : 'right' });
Types
cosyAlert('<strong>Alert</strong><br />I\'m gonna tell you something...', 'alert');
cosyAlert('<strong>Notice</strong><br />Come closer, listen up...', 'notice');
cosyAlert('<strong>Success</strong><br />You have done som successfull things...', 'success');
cosyAlert('<strong>Error</strong><br />But you are prone to errors !', 'error');