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