0
<table id="result">
<a href='#' class='pop'><span class='fa fa-eye'><img src='image link here' style='display:none'></a>
</table>
上記のhrefを使用してイメージをモーダルで開きます。画像ajaxを使用してコンテンツを読み込むときにダイアログモーダルでプレビューが動作しない
Modal For Image Preview:
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="position:absolute">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<img src="" class="imagepreview" style="width: 100%;" >
</div>
</div>
</div>
</div>
jqueryの(その1 +その2)下記のザ・親ページで動作しますが、テーブルのコンテンツはプレビューが機能していないAJAXを使用してロードされるたびに。
jQuery for modal show:
part1 : $(function() {
$('.pop').on('click', function(e) {
e.preventDefault();
$('.imagepreview').attr('src', $(this).find('img').attr('src'));
$('#imagemodal').modal('show');
});
});
パート1は親ページで動作します。
Part2 :$("#results").on("click",".pop", function(){
//alert("hello");
e.preventDefault();
$('.imagepreview1').attr('src', $(this).find('img').attr('src'));
$('#imagemodal1').modal('show');
});
part2もアラートを表示していますが、画像プレビューは機能していません。 ご協力いただければ幸いです。