layui 表格图片放大


1. 表格塞图片

,{title: '图片', width:120, templet: function(d) {
                                        return '<div onclick="show_img(this)" ><img src="'+d.image_path+'" ' +
                                        'alt="" 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>'
            });
        }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM