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') + " />"
                });
            })
  • 相关阅读:
    codevs 2021 中庸之道
    bzoj 1227: [SDOI2009]虔诚的墓主人
    cogs 2620. [HEOI2012]朋友圈
    bzoj 3123: [Sdoi2013]森林(45分暴力)
    cogs 1685 魔法森林
    bzoj 1061: [Noi2008]志愿者招募
    poj 1743 Musical Theme
    bzoj 1001: [BeiJing2006]狼抓兔子
    bzoj 4006: [JLOI2015]管道连接
    hdu 5693 D Game
  • 原文地址:https://www.cnblogs.com/bkhdd/p/15581990.html
Copyright © 2011-2022 走看看