1、 引用微信的JS
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
2、初始化点击放大监听方法
var imgList=[]; $("#box").on(‘click‘,".imgclass",function(e){ e.stopPropagation(); var that=$(this); var imgs=that.attr(‘src‘); var nowImgUrl= that.attr(‘src‘); if(!imgList.includes(imgs)){ imgList.push(imgs); } WeixinJSBridge.invoke("imagePreview",{ "urls":imgList, "current":nowImgUrl }); });