zoukankan      html  css  js  c++  java
  • layui 列表图片

     table.render({
                elem: '#test-table-form'
                ,url:"{:url('/backend/MemberFriendDynamicsFictitious/getFictitiousMemberList')}"
                ,cellMinWidth: 80
                ,cols: [[
                    {field:'id', title:'ID', 100, unresize: true}
                    ,{field:'nickname', title:'认证用户昵称111',}
                    ,{field: 'member_img', title: '头像', align: "center",templet: function (d) {
                            return "<span><img class='imgs' id=\"pic_" + d.id + "\" src=\"" + d.member_img + "\"  style=\" 40px\" lay-event=\"showPic\" ></span>";
                        }},
                    ,{field:'sex', title:'性别',templet:function(d){
                        if(d.sex == 1){
                            return d.sex = '男';
                        }else if(d.sex == 2){
                            return d.sex = '女';
                        }
                    }}
                    ,{field:'age', title:'年龄',}
                    ,{field:'address', title:'位置',}
                    ,{field:'lon', title:'经纬度',templet:function(d){
                        return d.lon = d.lon+','+d.lat;
                    }}
                    ,{field:'create_time', title:'创建时间',}
                ]]
                ,page: true
            });
    
    
            var area = [];
            if (window.screen.width > 1680 && window.screen.width <= 1920) {
                area = ['58%', '96%']
            } else if (window.screen.width > 1600 && window.screen.width <= 1680) {
                area = ['78%', '86%']
            } else if (window.screen.width > 1366 && window.screen.width <= 1600) {
                area = ['78%', '86%']
            } else if (window.screen.width <= 1366) {
                area = ['78%', '86%']
            }
    
            $(document).on('click','.imgs',function(){
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    shadeClose: true, //点击阴影关闭
                    area: area , //宽高
                    // area: [$(this).width + 'px', $(this).height + 'px'], //宽高
                    content: "<img src=" + $(this).attr('src') + " />"
                });
            })
  • 相关阅读:
    springbatch入门练习(第一篇)
    rabbitmq安装错误集
    动态代理和反射概念剖析
    RPC使用rabbitmq实现
    spring amqp初步了解
    aips初步设想
    静态工厂方法和实例工厂方法及普通的bean
    HDU4403(暴搜)
    CodeForces 446B
    HDU5505
  • 原文地址:https://www.cnblogs.com/bkhdd/p/15581990.html
Copyright © 2011-2022 走看看