1

Actually i have an iframe in my bootstrap modal, the content of the iframe is dynamic as it's loaded from the server so it's height can be different.

The question is how can i set the height dynamically?

Here is my modal

  <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>
NiceToMytyuk
  • 2,262
  • 17
  • 47
  • 1
    These two articles will help your cause: [Resizing an iframe based on content](https://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content) [How to resize Twitter Bootstrap modal dynamically based on the content](https://stackoverflow.com/questions/16152275/how-to-resize-twitter-bootstrap-modal-dynamically-based-on-the-content) – cfnerd Jan 31 '19 at 17:05
  • looks like > https://stackoverflow.com/questions/9162933/make-iframe-height-dynamic-based-on-content-inside-jquery-javascript – RK_oo7 Jan 31 '19 at 18:37

0 Answers0