No arguments is required for jquery.msgbox, however,
you have to pass an ampty object {} to either $.msgbox or $(...).msgbox.
Because $.msgbox() and $(...).msgbox() are used to retrieve msgbox objects
These are shortcuts. You can add different style width selector .jMsgbox-alert .jMsgbox-loaded
To replace window.alert width jquery.msgbox alert shortcut:
var _alert = window.alert;
window.alert = function (msg) {
$.msgbox({type:'alert', content: msg});
};
window.alert('Something');
// recover original alert
window.alert = _alert;
$(".msgbox.alert").msgbox({
type: 'alert',
content: 'This is an alert!',
title: 'Alert'
});
$(".msgbox.info").msgbox({
type: 'info',
content: 'This is an info!',
title: 'Info'
});
$(".msgbox.warning").msgbox({
type: 'warning',
content: 'This is a warning!',
title: 'Warning'
});
$(".msgbox.error").msgbox({
type: 'error',
content: 'This is an error!',
title: 'Error'
});
$(".msgbox.success").msgbox({
type: 'success',
content: 'This is a success!',
title: 'Success'
});
Change the default settings:
Change the overlay click event to 'close' (default: 'flash')
Resize button (bottom right) not available any more
Change langauge to Simplifed Chinese
Multiple instances could be generated by $.msgbox;
they could be minimized to the top or bottom of the window (emulating the task bar).
The msgbox generated by $(...).msgbox will be arraged to the task bar.
$(".msgbox.multi").click(function(){
var id = parseInt(5*Math.random());
$.msgbox({
type: 'alert',
title: 'msgbox: ' + id,
content: 'hello' + id,
overlay: false,
icons: ['min', 'max', 'close'],
id: id
});
});
$(".msgbox.close0").click(function(){
var msgbox = $.msgbox(0)
if (msgbox) msgbox.close();
});
$(".msgbox.restore0").click(function(){
var msgbox = $.msgbox(0)
if (msgbox) msgbox.restore();
});
$(".msgbox.min0").click(function(){
var msgbox = $.msgbox(0)
if (msgbox) msgbox.min();
});
$(".msgbox.closeall").click(function(){
$.msgbox.closeAll();
});
$(".msgbox.restoreall").click(function(){
$.msgbox.restoreAll();
});
$(".msgbox.minall").click(function(){
$.msgbox.minAll();
});
$(".msgbox.fn").msgbox({
type: 'alert',
overlay: false,
icons: ['min', 'max', 'close'],
content: 'This will not be minimized to the task bar.'
});