bootstrap image viewer 图片放大查看

教程分享 > Java教程 > 博文分享 (34726) 2024-03-05 14:05:05

已封装成为插件欢迎使用及反馈

插件下载:(访问密码9987)
bootstrap-viewer.zip


bootstrap image viewer 图片放大查看

实现效果:

小图
小图

 

大图
大图

 

<!DOCTYPE html>
<html>
<head>
	<title>bootstrap 图片查看</title>
	<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<td>
	<center>
		<img style="height: 100px;width: 100px;" 
		onmouseover="this.style.cursor='pointer';this.style.cursor='hand'" 
		onmouseout="this.style.cursor='default'"  
		src="test.jpg" 
		onclick="javascript:showimage('./test.jpg');" />
	</center>
</td>
  

		<!--放大图的imgModal-->
        <div class="modal fade bs-example-modal-lg text-center" id="imgModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" >
          <div class="modal-dialog modal-lg" style="display: inline-block; width: auto;">
            <div class="modal-content">
             <img  id="imgInModalID"  
			 class="carousel-inner img-responsive img-rounded" 
			 onclick="closeImageViewer()"
			 onmouseover="this.style.cursor='pointer';this.style.cursor='hand'" 
			 onmouseout="this.style.cursor='default'"  
			 />
            </div>
          </div>
        </div>
<script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</body>
<script type="text/javascript">
	//显示大图    
   function showimage(source)
     {
         $("#imgModal").find("#imgInModalID").attr("src",source);
         $("#imgModal").modal();
     }
	 //关闭
	function closeImageViewer(){
		$("#imgModal").modal('hide');
	}
</script>
</html>

 


相关文章
已封装成为插件欢迎使用及反馈插件下载:(访问密码9987)bootstrap-viewer.zipbootstrap image viewer 图片放大查看实现效果:小图  大图  &lt;!D...
bootstrap-table pageNumber无法获取值解决
Bootstrap-tab 组件增强插件效果图​​bootstrap-tab组件是对原生的bootstrap-tab组件的封装,方便开发者更方便地使用,主要包含以下功能:tab页初始化关闭tab...
bootstrap table插件使用说明demo
jQuery的$.ajax()使用及API文档,jQuery,ajax,$.ajax()
bootstrap table跨域问题完美解决
​Bootstrap TableBootstrap Table 多选以及获取多选值实现本文主要讲解在bootstrap table组建使用过程中,配置多选和获取多选选中的值
问题描述最近一个项目遇到Bootstrap Table pageList 配置不生效,配置多个选项后无法还是无法弹出选择
Bootstrap Tab基础使用,首先是引入必要的css和js,这里暂时忽略核心代码:&lt;ul class="nav nav-tabs"&gtl; ...
bootstrap-select ajax动态添加值中遇到的IE兼容问题解决
ie9 jquery ajax跨域问题解决, ajax ie9 跨域问题解决,jquery,ajax,ie9
jQuery 取选中的radio的值方法,jQuery,radio
在Bootstrap Table 使用过程中,从表格的columns里面的value取一些特殊字符的值会被转义,比如 &符号会被转义城&amp;
jQuery select 获取值$title(方法一:) let val=$('#selectId').val(); //获取选中值 $title(方法二:) let val=$('#se...
Bootstrap Tab 示例代码&lt;div class="tabs-container"&gtl; &lt;ul class="nav nav-tabs"&gtl; &lt;l...