我使用ace admin template來開發網站,但我有問題將自舉模式放置在iframe頁面的中心,當我向下滾動時,像這樣。在向下滾動的頁面的中心顯示引導模式
$('#modalId').modal({
show:true,
backdrop:'static'
})
如何進行模態彈出當前視圖的中心?
我使用ace admin template來開發網站,但我有問題將自舉模式放置在iframe頁面的中心,當我向下滾動時,像這樣。在向下滾動的頁面的中心顯示引導模式
$('#modalId').modal({
show:true,
backdrop:'static'
})
如何進行模態彈出當前視圖的中心?
<script language="javascript">
this.getTopWindow(window).ui_confirm(content);
function ui_confirm(msg, confirm, cancel){
bootbox.dialog({
message: "<h5>"+msg+"<h5>",
animate: false,
closeButton: false,
size: "small",
buttons: {
main: {
label: "取消",
className: "btn-inverse btn-sm",
callback: function() {
if (typeof cancel !== "undefined" && Object.prototype.toString.call(cancel) === "[object Function]") {
cancel();
}
}
},
danger: {
label: "確定",
className: "btn-primary btn-sm",
callback: function() {
if (typeof confirm !== "undefined" && Object.prototype.toString.call(confirm) === "[object Function]") {
confirm();
}
}
}
}
});
}
</script>
var scrollTop = window.gui.getTopWindow(window).scrollY;
if(scrollTop > 200){
$('#modalId').find('.modal-content').css('top',(scrollTop-50)+'px');
}
$('#modalId').modal({
show:true,
})
$('#modalId').modal({
show:true,
}).css({
'margin-top': function(){
return window.gui.getTopWindow(window).scrollY;
}
});
謝謝,它的工作原理。 – fusu