0
我使用blueimp jQuery文件上传和引导对话框(https://nakupanda.github.io/bootstrap3-dialog/),有没有办法使用blueimp从引导对话框按钮(BootstrapDialog.show)上传?似乎无法找到在引导对话框按钮上创建jQuery选择器并将其挂接到文件上载的方法。有没有办法使用blueimp从引导对话框上传?
我使用blueimp jQuery文件上传和引导对话框(https://nakupanda.github.io/bootstrap3-dialog/),有没有办法使用blueimp从引导对话框按钮(BootstrapDialog.show)上传?似乎无法找到在引导对话框按钮上创建jQuery选择器并将其挂接到文件上载的方法。有没有办法使用blueimp从引导对话框上传?
如果您在这一刻唯一关心的是建立在一个引导对话框按钮jQuery选择,请尝试以下:
BootstrapDialog.show({
\t title: 'Example',
message: 'Write your example here.',
buttons: [{
\t id: 'btn-close',
\t \t label: 'Close',
action: function(dialog) {
\t dialog.close();
}
}],
onshown: function(dialog) {
// This is a jQuery object
\t var $btnClose = dialog.getButton('btn-close');
$btnClose.hide();
}
});
在这个例子中,你可以通过获得按钮id通过对话框实例的getButton()方法,返回的对象是用jQuery包装的按钮。
这里一个的jsfiddle http://jsfiddle.net/ubx2mbmz/1/
你也可以做一个传统的jQuery的方式相似:
BootstrapDialog.show({
\t title: 'Example',
message: 'Write your example here.',
buttons: [{
\t \t label: 'Close',
action: function(dialog) {
\t dialog.close();
}
}],
onshown: function(dialog) {
\t var $btnClose = dialog.getModalFooter().find('button');
$btnClose.hide();
}
另外这里的jsfiddle http://jsfiddle.net/7ftsc50n/1/
感谢那些为我工作@badboy ! – afzal273