我正在使用来自http://bootboxjs.com/examples.html的bootbox.js,它非常出色。但是我在设置对话框位置时遇到了一个问题。
我希望将对话框放置在屏幕中央。我正在使用此代码,但对话框始终停留在屏幕顶部。
bootbox.alert('Danger!!').find('.modal-content').css({
'background-color': '#f99',
'font-weight': 'bold',
color: '#F00',
'top': '50%',
'margin-top': function() {
return -(box.height() / 2);
},
'font-size': '2em',
'font-weight': 'bold'
});
请告知如何将对话框置于屏幕中央。