« jQuery Alert Dialogs (Alert, Confirm, & Prompt Replacements)

基本范例

Info
jAlert('This is a custom alert box', 'Alert Dialog');

Warning
jAlert('This is a custom alert box', 'Warning Dialog');

Alert
jAlert('This is a custom alert box', 'Alert Dialog');

Alert
jAlert('This is a custom alert box', 'Alert Dialog');

Confirm
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
    jAlert('Confirmed: ' + r, 'Confirmation Results');
});

Prompt
jPrompt('Type something:', 'Prefilled value', 'Prompt Dialog', function(r) {
    if( r ) alert('You entered ' + r);
});

高级范例

对话框带HTML代码
jAlert('You can use HTML, such as bold, italics, and underline!');

Alternate Styles

By changing the value of the $.alerts.dialogClass property (and creating your own CSS class), you can changes the style of your dialogs:

View the plugin source for additional properties that can be modifed at runtime.

Back to the project page



获取更多JavaScript代码,请登录JavaScript分享网 http://www.sharejs.com