bootstrap 3:模态框中的响应式内容div

时间:2014-07-10 12:20:04

标签: jquery html css twitter-bootstrap

我将jquery位置选择器添加到bootstrap模态3的内容框中。height:400px;width:500px像这样:

HTML:

<a data-toggle="modal" href="#myModal" class="btn btn-primary">Launch modal</a>

<div class="modal" id="myModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                 <h4 class="modal-title">Modal title</h4>

            </div>
            <div class="modal-body">Location:
                <input type="text" id="us2-address" style="width: 200px" />Radius:
                <input type="text" id="us2-radius" />
                <div id="us2" style="width: 500px; height: 400px;"></div>Lat.:
                <input type="text" id="us2-lat" />Long.:
                <input type="text" id="us2-lon" />
            </div>
            <div class="modal-footer"> <a href="#" data-dismiss="modal" class="btn">Close</a>
 <a href="#" class="btn btn-primary" id="save-changes">Save changes</a>

            </div>
        </div>
    </div>
</div>

现在,我需要在模式框中创建响应式谷歌地图div(id="us2")。如何创建这个?

演示:http://jsfiddle.net/Lzv7w/1/

1 个答案:

答案 0 :(得分:1)

只需从div的style属性中删除width属性,其中id =&#34; us2&#34; ,如下所示

<div id="us2" style="height: 400px;"></div>

演示:http://jsfiddle.net/Lzv7w/2/