zoukankan      html  css  js  c++  java
  • Layer弹层组件 二次扩展,项目中直接使用。

    /************************ Layer扩展 ****************************/
    
    /*
    * Layer弹出Alert提示框
    * @param message 提示信息
    * @param type 类型 1成功 2失败 3疑问 7提示
    * @param fn (可选)点击后回调方法
    * @return
    */
    function LayerAlert(message, type, fn) {
        layer.alert(message, { icon: type }, fn);
    }
    
    
    /*
    * Layer弹出Confirm提示框
    * @param message 确认提示信息
    * @param okfn 确认后回调 function (index) { alert("确认操作后回调,一般执行程序,完成后layer.close(index)关闭Layer"); }
    * @param errorfn (可选)取消操作后回调 function () { alert("取消操作后回调"); }
    * @return
    */
    function LayerConfirm(message, okfn, cancelfn) {
        layer.confirm(
                message,
                { btn: ['确定', '取消'] },
                okfn,
                cancelfn
            );
    }
    
    /*
    * Layer弹出新窗口
    * @param url 网址
    * @param title 标题
    * @param width 宽
    * @param height 高
    * @param closefn (可选)关闭后回调 function (index) { alert("关闭"); layer.close(index);}
    * @return
    */
    function LayerOpen(url, title, width, height, closefn) {
        layer.open({
            type: 2,
            title: title,
            shadeClose: false, //必须点弹窗关闭按钮关闭
            shade: 0.5,
            area: [width, height],
            content: url, //让iframe出现滚动条content: ['http://www.xxx.com', 'no']
            cancel: closefn
        });
    }
    
    /*
    * Layer加载效果(自动关闭)
    * @param type 0-2加载效果
    * @param minute 几秒钟后消失
    * @return
    */
    function LayerLoadAuto(type, second) {
        layer.load(type, { time: second * 1000, shade: 0.1 });
    }
    
    /*
    * Layer加载效果
    * @param type 0-2加载效果
    * @return
    */
    function LayerLoad(type) {
        var index = layer.load(type);
        return index;
    }
    
    /*
    * Layer关闭
    * @param index 打开的index
    * @return
    */
    function LayerClose(index) {
        layer.close(index);
    }


  • 相关阅读:
    mysql自增长字段设置
    查看docker的挂载目录
    centos rpm安装jdk1.8
    mybatis-地区三表生成地区树
    post表单、json接口
    git子模块使用
    解决Windows系统80端口被占用
    交换机基础命令
    JMX协议
    WMI协议
  • 原文地址:https://www.cnblogs.com/smartsmile/p/6234020.html
Copyright © 2011-2022 走看看