完整例子的html,直接打开可看到效果

<!DOCTYPE html>
<html>
<head><title>bootstrap 图片查看</title>
<!--  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">--><link href="https://cdn.bootcss.com/bootstrap/3.4.1/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="E:\idea_workspace\\images\01944d5cd14772a801208f8be3cb63.jpg@1280w_1l_2o_100sh.jpg"         onclick="javascript:showimage('E:\\idea_workspace\\images\\01944d5cd14772a801208f8be3cb63.jpg@1280w_1l_2o_100sh.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/jquery/1.12.4/jquery.min.js"></script>
<!--<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>-->
<script src="https://cdn.bootcss.com/bootstrap/3.4.1/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>

项目中通过img的src和js动态设置img,动态设置点击事件传递参数

定义img

<img id="guideImageNameMd5DivImg" class="col-sm-8 img-responsive"onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"onmouseout="this.style.cursor='default'"src=""onclick="javascript:showimage(this.src);"/>

设置路径的方法

function setGuideImage(path){var guideImageNameMd5DivImg = $('#guideImageNameMd5DivImg');     guideImageNameMd5DivImg.attr('src','file://'+path+'');
}

html,bootstrap,js,jquery图片点击模态窗口放大图片,可以滚动常看长图相关推荐

  1. 微信浏览器返回刷新,监听微信浏览器返回事件,网页防复制,移动端禁止图片长按和vivo手机点击img标签放大图片

    以下代码都经过iphone7,华为MT7 ,谷歌浏览器,微信开发者工具,PC端微信验证.如有bug,还请在评论区留言. demo链接:https://pan.baidu.com/s/1c35mbjM ...

  2. 微信html 全屏显示,关于微信上网页图片点击全屏放大效果

    实现微信上网页的图片点击后全屏还可以可以缩放,这个功能是别人做的,可是捏点击后屏幕直接黑屏了,图片没有显示出来.这个代码在网上搜一下,挺多类似的. 先上代码. 调用微信图片浏览器的函数 functio ...

  3. h5点击图片自动放大_关于微信上网页图片点击全屏放大效果

    实现微信上网页的图片点击后全屏还可以可以缩放,这个功能是别人做的,可是捏点击后屏幕直接黑屏了,图片没有显示出来.这个代码在网上搜一下,挺多类似的. 先上代码. function arrayToJson ...

  4. android 图片点击一下就放大到全屏,再点一下就回到原界面

    /*android 图片点击一下就放大到全屏,再点一下就回到原界面 */ public class MainActivity extends Activity { /** Called when th ...

  5. js源生实现图片点击弹出放大效果

    参考https://blog.csdn.net/qq_36375934/article/details/78952485 的弹出框查看大图,同时总结自己遇到的问题,做个笔记 HTML代码 <!D ...

  6. vue列表左右箭头滑动_vue.js+elementUI实现点击左右箭头切换头像功能(类似轮播图效果)...

    1.效果图如下 2.vue代码如下 indicator-position="none" :autoplay="false"> > {{items.b ...

  7. word转pdf图片模糊怎么办_迅捷PDF转换器如何将word转为长图?word转图片方法

    在日常工作中,我们基本都用word来编辑文档,编辑完成,如果将它保存为其他格式,那可能会出现跑版的情况.为了解决这一问题,我们可以用迅捷PDF转换器将word转长图,这样也方便在手机上阅读.只是很多人 ...

  8. 公众号滑动图代码_公众号怎么制作图片滑动的效果?怎么做可以上下滑动的长图?...

    微信公众号图片怎么制作呢?图片太多又该怎么排版呢?接下来就和小编一起看看,怎么使用壹伴助手这款公众号编辑器,来实现公众号图片的排版吧~ 怎么使用公众号制作多图滑动的效果 在公众号文章中,如果插入的图片 ...

  9. Linux 图片扩大软件,想要放大图片又担心图片会变得模糊不看?让这款无损放大软件来帮你...

    如果在网站上看到一张非常喜欢的图片可是太小怎么办?这款Bigjpg图片放大器就能满足您的需要.(支持Windows.macOS.Android.Linux/iOS可使用网页版) 这是一款功能强大的图片 ...

最新文章

  1. 全球可持续发展标准化城市联盟首个海外会议基地落户杭州
  2. 迷失lost结局什么意思_沉默的真相结局是什么意思?严良为什么把球送给江阳儿子?...
  3. poj3069 Saruman's Army(贪心)
  4. ios上传音频文件到服务器,IOS开发:iPod的音乐库中的音频如何上传到服务器中...
  5. spring-boot actuator(监控)配置和使用
  6. 高德地图时间和实际差多少_带着“高德地图”去工作
  7. python 正则匹配手机号
  8. [资料]自动化e2e测试 -- WebDriverJS,Jasmine和Protractor
  9. 生态系统服务——水源涵养水源涵养分布数据
  10. devcon命令开启启用/禁用端口
  11. php网页版进销存源码ERP多仓库管理系统源码
  12. Axure8.0汉化包+注册码
  13. SQL 当天在当月、当季度、当年的时间进度
  14. 如何才能把文字的排版做好
  15. Verilog 语言基础
  16. 毕业设计 python的微信公众平台机器人
  17. 优动漫PAINNT——漫画原稿纸的基础知识介绍
  18. iOS-UITableView 中自定制cell上UIButton互斥事件
  19. 【工作技巧】医疗行业标准查询方式
  20. 「多校联考」第三周二场

热门文章

  1. 计算机一级excel0分,探究计算机一级Word和Excel操作自动评分的实现
  2. jQuery_02 快速入门 $作用和方法
  3. 从C到B,20岁的腾讯正在经历一场“生死”腾挪
  4. LayUI 后台管理模板
  5. [MetalKit]45-Using eGPUs with Metal 在 eGPU上使用 Metal
  6. C# 静态和非静态的区别
  7. carla Engine crash handling finished; re-raising signal 11 for the default handler. Good bye.
  8. C/C++编程:模板特例
  9. SolidWorks快速安装螺栓
  10. 【研究生】学会这几步,还怕不会写硕士论文?