如何动态地将高度设置为模态?

时间:2019-01-31 16:54:04

标签: javascript jquery html

实际上,我的引导程序模式中有一个iframe,因为iframe是从服务器加载的,所以它的内容是动态的,因此它的高度可以不同。

问题是如何动态设置高度?

这是我的模态

  <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">

            <!--Content-->
            <div class="modal-content">

                <!--Body-->
                <div class="modal-body mb-0 p-0">

                    <div class="embed-responsive z-depth-1-half" style="height: 100%">
                        <iframe id="frame" class="embed-responsive-item" src="frameticket.aspx"></iframe>
                    </div>

                </div>
                <div class="modal-footer bg-light">
                    <div class="form-group" style="width: 100%">
                        <label for="exampleFormControlTextarea1" class="mt-2" style="margin-bottom: -10px">Risposta:</label>
                        <textarea class="form-control" id="exampleFormControlTextarea1" rows="2" style="height: auto"></textarea>
                        <a href="#" class="btn btn-success btn-fill pull-left mt-1">Invia risposta</a>
                        <button type="button" class="btn btn-danger btn-fill mt-1 pull-right" data-dismiss="modal">Chiudi</button>
                    </div>

                </div>
            </div>
            <!--/.Content-->

        </div>
    </div>

0 个答案:

没有答案
相关问题