【问题标题】:Make a Modal at the Top Left Corner of the Window在窗口的左上角制作一个模态框
【发布时间】:2015-03-16 17:32:35
【问题描述】:

我有一个使用 Jquery UI 库 (http://jqueryui.com/dialog) 创建的模式。以下是我的代码:

$("#mypreview_modal").dialog({
    autoOpen: false,
    draggable: true,
    height: 520,
    modal: true,
    resizable: false,
    width: 525, 
    buttons: {
        "Print": function() {                                  
        },
        "Close": function() {                   
          $( this ).dialog( "close" );
        }
    }        
}); 

我想将我的对话框定位在窗口的左上角,右侧的垂直滚动条位于窗口的右上角。

【问题讨论】:

  • 如果 #mypreview_modal 位置是绝对的,则使用 css。然后添加顶部:0;左:0;在css代码中

标签: javascript jquery html css jquery-ui


【解决方案1】:
#mypreview_modal {
  position: absolute;
  top: 0px;
  left: 0px
}

【讨论】:

    【解决方案2】:
    position:absolute;
    top:0;
    left:0;
    

    【讨论】:

    • 根据截图需要添加left:0; ?
    • 是的,如果你想要它在左角而不是使用 left:0;或者如果你想要正确而不是正确:0;
    • 是的,但问题是关于在左侧弹出。 :)
    猜你喜欢
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-27
    • 1970-01-01
    • 2013-11-21
    相关资源
    最近更新 更多