【问题标题】:How to open a jquery dialog over opened Bootstrap Modal?如何在打开的 Bootstrap 模式上打开 jquery 对话框?
【发布时间】:2023-04-06 23:10:01
【问题描述】:

单击链接时,我打开了一个引导模式。现在我想通过在打开的 Bootstrap 模式上单击另一个链接按钮(链接按钮位于 Bootstrap 模式中)来打开一个对话框。对话框打开时没有任何问题,但 Bootstrap 隐藏了此对话框。对话框出现在模式下。我想通过引导程序打开,我该怎么做?

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
function projectImageAttr(imageID) {
    console.log(imageID);
    $("#dialog").dialog({
        width: 900,
        show: {
            effect: "blind",
            duration: 1000
        },
        hide: {
            effect: "explode",
            duration: 1000
        },
        resizable: "auto",
        modal: true
    });
}

【问题讨论】:

  • 检查 CSS 中对话框的 z-index 并根据需要进行更改。

标签: javascript jquery html css twitter-bootstrap


【解决方案1】:

我发现从版本 1.10.0+ 开始,有一个选项可以使用 appendTo 选项将对话框“附加”到模式。目前在 Bootstrap 4 上使用它。

$("#yourDialogId").dialog({
    autoOpen: false,
    appendTo: "#yourModalId",
    modal: true,
});

【讨论】:

    猜你喜欢
    • 2020-06-26
    • 1970-01-01
    • 1970-01-01
    • 2018-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-10
    • 2012-05-03
    相关资源
    最近更新 更多