首页 > 其他 > 详细

layui 表格图片放大

时间:2019-02-28 23:01:02      阅读:409      评论:0      收藏:0      [点我收藏+]

1. 表格塞图片

,{title: ‘图片‘, width:120, templet: function(d) {
                                        return ‘<div onclick="show_img(this)" ><img src="‘+d.image_path+‘" ‘ +
                                        ‘ width="50px" height="50px"></a></div>‘;

                                    }}

2. 图片放大

//显示大图片
        function show_img(t) {
            var t = $(t).find("img");
            //页面层
            layer.open({
                type: 1,
                skin: ‘layui-layer-rim‘, //加上边框
                area: [‘80%‘, ‘80%‘], //宽高 t.width() t.height() 
                shadeClose: true, //开启遮罩关闭
                end: function (index, layero) {
                    return false;
                },
                content: ‘<div style="text-align:center"><img src="‘ + $(t).attr(‘src‘) + ‘" /></div>‘
            });
        }

 

layui 表格图片放大

原文:https://www.cnblogs.com/cjjjj/p/10453517.html

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