从表单文件输入中选择图像时,如何在模式弹出窗口中打开图像?
<input type="file" class="form-control">
You can get the Base64 from the input field and then append it to an <img>
element, inside your modal. Find details in the link below.
You can use fancybox, but if you use base64 encode you have to set some setting for the image...like this:
<script type="text/javascript">
$(document).ready(function () {
$('.fancybox-cs').fancybox({
type : 'image'
});
});
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.