微信內置瀏覽器圖片查看器的使用

話很少說,直接上代碼瀏覽器

var imgs = new Array();
$("img").each(function () {
    //這裏的圖片路徑要直接能在瀏覽器中打開的完整的url路徑
     imgs.push($(this).attr('src'));
});
$("img").on('click', function () {
     var path = $(this).attr('src');//這裏的圖片路徑要直接能在瀏覽器中打開的完整的url路徑
      WeixinJSBridge.invoke('imagePreview', {
         'current': path,
          'urls': imgs
      });
});
相關文章
相關標籤/搜索