layui 常用

layui优化滚动条
    /* 设置滚动条的样式 */
    ::-webkit-scrollbar {width: 6px;}
    /* 外层轨道 */
    ::-webkit-scrollbar-track {-webkit-box-shadow: inset006pxrgba(255, 0, 0, 0.3);background: rgba(0, 0, 0, 0.1);}
    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {border-radius: 4px;background: rgba(0, 0, 0, 0.2);-webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);}
    ::-webkit-scrollbar-thumb:window-inactive {background: rgba(0, 0, 0, 0.2);}

layui弹窗使用

layer.open({
            type: 2
            , title: '选择负责人'
            , content: '{SITE_URL}man.php?c=Home_basic_ggsl&m=secOnePerson&supervisor=' + supervisor
            , area: ['500px', '500px']
            , maxmin: true
            , btn: ['确定', '取消'] //可以无限个按钮
            , yes(index, layero) {
                //执行弹窗页面的方法
                let iframeWin = window[layero.find('iframe')[0]['name']];
                iframeWin.getMember();//执行弹窗内部的方法
                let body = layer.getChildFrame('body', index);//获取弹窗的数据
                let data = {};
                body.find("#myform").serializeArray().forEach(function (item) {
                    data[item.name] = item.value;
                });
                layer.close(index);
            }
            , btn2: function (index) {
                layer.close(index);
            }
        })

可以通过form的id获取表单数据;body.find("#myform").serializeArray() 得到的就是一组对象;需要转化为一个数组数据返回;data就是最后获取到的数据。

 

posted @ 2022-12-27 16:34  moppet蔡蔡  阅读(92)  评论(0编辑  收藏  举报