загрузить изображения на модель начальной загрузки и загрузить новое загруженное изображение

 <div class="modal fade" id="profilePicModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body"><div id="jsoneditor">
<img src="" id="profilePic" style="width: 100%; height: 100%;" >
</div></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
$("#image").on("click", function() {
$('#profilePic').attr('src', $(this).attr('value'));
$('#profilePicModal').modal('show');
$('#profilePic').cropper({
aspectRatio: 16 / 9,
crop: function(e) {

}
});
});

0

Решение

Ниже приведен код для изменения изображений в зависимости от выбора пользователя. Изображения размещаются в той же папке, что и файл HTML.

<script>
function go(loc) {
document.getElementById('imagechange').src = loc;
}
</script>

<body>
<iframe id="imagechange" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"></iframe>

<form method="post">
<input name="calendarSelection" type="button" Value=" River1" onclick="go('river2.jpg')" />
<input name="calendarSelection" type="button" value=" GitHub" onclick="go('riverrafting.jpg')" />
<input name="calendarSelection" type="button" value=" Wikipedia"  onclick="go('Employee.jpg')" />

</form>

</body>
0

Другие решения

Других решений пока нет …