首页 > 代码库 > bootstrap-dialog插件的使用

bootstrap-dialog插件的使用

官网文档:http://nakupanda.github.io/bootstrap3-dialog

BootstrapDialog.show({

message: ‘Hi Apple!‘,

message: ‘You can not close this dialog by clicking outside and pressing ESC key.‘,

closable: true, //是否可关的图标

closeByBackdrop: false, //点击空白处是否关掉

closeByKeyboard: false,//使用键盘上的esc键是否关掉

buttons: [{

label: ‘Close the dialog‘,

action: function(dialogRef){ dialogRef.close(); }

}]

});

BootstrapDialog.show({

message: ‘Hello world!‘,

onshow: function(dialogRef){

 alert(‘Dialog is popping up, its message is ‘ + dialogRef.getMessage());

},

onshown: function(dialogRef){

alert(‘Dialog is popped up.‘);

},

onhide: function(dialogRef){

alert(‘Dialog is popping down, its message is ‘ + dialogRef.getMessage());

},

onhidden: function(dialogRef){

alert(‘Dialog is popped down.‘);

}

});

//onshow正在加载的时候触发,元素可以获得,但是页面没有加载,

onshown dialog加载完成后触发

onhide dialog正在隐藏时触发

onhiden dialog隐藏后触发

技术分享

 

bootstrap-dialog插件的使用