首页 > 移动平台 > 详细

PhotoSwipe手机端图片弹出显示插件【使用笔记】

时间:2019-04-17 13:30:06      阅读:202      评论:0      收藏:0      [点我收藏+]
官网:https://photoswipe.com/

代码下载地址:
http://down.51cto.com/data/2303672

技术分享图片

特别注意:使用的时候会报错:

在移动端开发时使用photoswipe插件报错 Uncaught TypeError: Cannot read property ‘x‘ of undefined

解决办法:

https://www.cnblogs.com/zxlshare/p/6472418.html

        //处理:photoswipe插件报错 Uncaught TypeError: Cannot read property ‘x‘ of undefined
        function setpic() {
            $(".demo-gallery img").each(function () {
                var imgs = new Image();
                imgs.src = $(this).attr("src");
                var w = imgs.width * 10, h = imgs.height * 10;
                $(this).parent("a").attr("data-size", "").attr("data-size", w + "x" + h);
            })
        }

PhotoSwipe手机端图片弹出显示插件【使用笔记】

原文:https://blog.51cto.com/xuqin/2379982

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!