Please don't delete or close this question I put my question here after full three days search.
My responsive website has many modals to display blocks of data. The modal works fine with the default width on browser and small devices.
When I increase modal width for browsers with in % (percentage) it works fine in only browser. But do not display properly in mobile phones and other devices.
I tried % with min-width etc etc but no luck... also boostrap modal documentation has no information regarding size. only there is a small and large size is available which do not fit to my requirements.
Secondly I am oppening the modals using JS code as:
$(".modal-body").html("Loading...");
$(".modal-body").load("fdeed.php");
$("#modal_appointments").modal();
$('#modal_appointments').modal('show');
Please, help me how I change the width so that it works fine in all devices. Any kind of help is highly appreciated. Thank you.
4条答案
按热度按时间6ioyuze21#
如果你使用的是bootstrap 3.1.0,尝试使用bootstrap提供的类,以便在较小的设备中使用模态。我个人从未在极小设备中测试过它。尝试使用
.modal-dialog
类的以下类.modal-sm
-适用于小型设备。.modal-lg
-适用于较大的装置。有用的链接
http://codepen.io/SitePoint/pen/KkHyw
希望能有所帮助,
pkmbmrz72#
将容器宽度设置为60%,覆盖边距并设置左侧位置应该可以满足您的需要:
您可以在以下位置找到完整的示例:http://www.bootply.com/I0V4kQgcMD
使用右边的移动的预览按钮在一个可以调整大小的新窗口中查看它。
rbpvctlc3#
可以通过编程方式调整最大宽度。
7ivaypg94#
首先,不要给modal给予宽度,如果您使用@media query,只需删除
删除modal-lg,然后它将工作