Css 在向下滚动的页面中央显示引导模式
我正在使用它来开发一个网站,但当我向下滚动时,我无法将引导模式放置在iframe页面的中心,如下图所示Css 在向下滚动的页面中央显示引导模式,css,twitter-bootstrap,bootstrap-modal,Css,Twitter Bootstrap,Bootstrap Modal,我正在使用它来开发一个网站,但当我向下滚动时,我无法将引导模式放置在iframe页面的中心,如下图所示 $('#modalId').modal({ show:true, backdrop:'static' }) 如何在当前视图的中心弹出模式? var scrollTop = window.gui.getTopWindow(window).scrollY; if(scrollTop > 200){ $('#modalId').find('.modal-conten
$('#modalId').modal({
show:true,
backdrop:'static'
})
如何在当前视图的中心弹出模式?
var scrollTop = window.gui.getTopWindow(window).scrollY;
if(scrollTop > 200){
$('#modalId').find('.modal-content').css('top',(scrollTop-50)+'px');
}
$('#modalId').modal({
show:true,
})
this.getTopWindow(窗口).ui\u confirm(内容);
功能ui_确认(消息、确认、取消){
bootbox.dialog({
消息:“+msg+”,
动画:假,
closeButton:false,
尺寸:“小”,
按钮:{
主要内容:{
标签:“取消",
类名:“btn反向btn sm”,
回调:函数(){
if(typeof cancel!=“undefined”&&Object.prototype.toString.call(cancel)==“Object Function]”){
取消();
}
}
},
危险:{
标签:“确定",
类名:“btn主btn sm”,
回调:函数(){
if(typeof confirm!=“undefined”&&Object.prototype.toString.call(confirm)==“Object Function]”){
确认();
}
}
}
}
});
}
<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>
$('#modalId').modal({
show:true,
}).css({
'margin-top': function (){
return window.gui.getTopWindow(window).scrollY;
}
});