【发布时间】:2015-09-15 16:14:16
【问题描述】:
我正在使用 Jcrop,这是我的模态:
<!-- START modal-->
<div id="camera" tabindex="-1" role="dialog" aria-labelledby="cameraLabel" aria-hidden="true" class="modal fade">
<div class="modal-dialog">
<div class="modal-content" style="margin-left: 10px; margin-top: 10px;">
<div class="modal-header">
<button type="button" data-dismiss="modal" aria-hidden="true" class="close">x</button>
<h4 id="cameraLabel" class="modal-title">Upload a photo of yourself</h4>
</div>
<div class="modal-body">
<form action="/overview/setprofileimage" method="POST" enctype="multipart/form-data" id="coords">
<div class ="form-group">
<span id="err_coords" style="color: #ff0000; float: left; text-align: center; width: 100%;"></span>
</div><br>
<input type='file' id="imgAvatar" name="image" onchange="readURLAvatar(this, 'avatar');" />
<img id="avatar" src="#" alt="your image" style="margin-top:10px; margin-bottom:10px; max-height: 100vh; max-width: 100vh;" />
<div class="inline-labels">
<input type="hidden" id="x" name="crop[x]" />
<input type="hidden" id="y" name="crop[y]" />
<input type="hidden" id="w" name="crop[w]" />
<input type="hidden" id="h" name="crop[h]" />
</div>
<br>
<input type="hidden" size="4" id="uplloadAvatar" name="uplloadAvatar" value=""/>
<button type="button" class="btn btn-danger btn-sm" onclick="checkCoordsImg(1);">Crop & Upload</button>
<button type="button" class="btn btn-success btn-sm" onclick="checkCoordsImg(2);">Upload</button>
</form>
<br>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
</div>
</div>
</div>
</div>
<!-- END modal-->
当用户上传大图片并且图片扩展了模态或变得比移动设备中的模态更大时,我的问题就出现了。我尝试限制模态对话框的宽度,但这不是响应式设计的好解决方案。
【问题讨论】:
标签: twitter-bootstrap bootstrap-modal jcrop