打开2个模态在彼此的顶部打破了我的滚动

时间:2016-01-21 12:18:48

标签: javascript jquery html css twitter-bootstrap

很明显,标题并不清楚,我会尝试更好地解释问题。

我有这种模式:

<div id="modalFinestraErogazione" class="modal fade" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog higherWider">
        <div class="modal-content">
            <div class="modal-header">
                <form:input path="codicePrescrizioneRiferimento" id="codicePrescrizione" type="hidden"/>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="chiudiErogazione()">&times;</button>
                <h4 class="modal-title">Erogazione farmaci</h4>
            </div>
            <div class="modal-body">
                <table class="table" id = "tabellaFarmaciPresccritti">
                    <tr><th>Farmaci prescritti</th><th>Dosaggi (die)</th><th>Durata confezione (Giorni)</th></tr>
                </table>
                <table class="table" id="tabellaErogati" bgcolor="#F8F8F8">
                    <tr><th class="col-sm-6">Farmaco</th><th class="col-sm-2">AIC</th><th class="col-sm-2">Targatura</th><th class="col-sm-1">Giorni</th><th class="col-sm-1"></th></tr>
                </table>
                <span class='col-sm-12 label-grande label-primary'>Note erogazione (a cura della farmacia)</span>
                <div class='form-group'><textarea class='form-control' rows='3' id='nota'></textarea></div>
                <div class='form-group'>
                    <span class="label-grande label-default">Durata complessiva terapia erogata (in giorni):</span>
                    <span class="label-grande label-default" id='durataComplessiva'></span>
                    <button type= "button" class="btn btn-primary pull-right" id="bottoneMessaggioMedico" style="width: auto;">Mostra messaggio del medico</button>
                </div>
                <div class='form-group'>
                    <table class="table">
                        <tr><th style="white-space:nowrap;">Tipo presidio: </th><td><select id="tipoPresidio" class="form-control"></select></td>
                        <th style="white-space:nowrap;">Tipo erogazione: </th><td><select id="tipoErogazione" class="form-control"></select></td></tr>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <div class = "col-sm-offset-6 col-sm-6">
                    <div class = "col-sm-6">
                        <button type="button" class="btn btn-primary" onclick="salvaErogazione()">Eroga</button>
                    </div>
                    <div class = "col-sm-6">
                        <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="chiudiErogazione()">Chiudi</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

在某些时候我表示使用:

$("#modalFinestraErogazione").modal('show');

一切正常,我添加和删除表格中的作品等,当窗口变得太长时,我可以将其向下滚动。

有时当用户出错时,我会使用此代码显示警告弹出窗口。

function finestraWarning(messaggio)
{
    BootstrapDialog.show({
        type : BootstrapDialog.TYPE_WARNING,
        title : "Attenzione",
        message : messaggio,
        size: BootstrapDialog.SIZE_NORMAL,
        buttons : [ {
            label : 'OK',
            cssClass : 'btn-warning',
            action : function(dialog) {
                dialog.close();
            }
        } ]
    });
}

并且一切仍然正常,但是当我关闭警告对话框时出现问题。 突然我可以向下滚动模态窗口了,相反,当我使用滚轮时,背景中的页面会移动。

我无法弄清楚原因。 我该怎么办,当我关闭警告窗口时,我仍然可以向下滚动模态窗口?

0 个答案:

没有答案