前台HTML:
<td><center><img style="height: 100px; 100px;" onmouseover="this.style.cursor='pointer';this.style.cursor='hand'" onmouseout="this.style.cursor='default'" src="<?php echo $v['pic_detail'];?>" onclick="javascript:showimage('<?php echo $v['pic_detail'];?>');" /></center></td> <div id="ShowImage_Form" class="modal hide"> <div class="modal-header"> <button data-dismiss="modal" class="close" type="button"></button> </div> <div class="modal-body"> <div id="img_show"> </div> </div> </div>
实现JS:
//显示大图 function showimage(source) { $("#ShowImage_Form").find("#img_show").html("<image src='"+source+"' class='carousel-inner img-responsive img-rounded' />"); $("#ShowImage_Form").modal(); }
实现效果: