• 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);
    }


  • 相关阅读:
    如遇临时表无法删除
    ORA-00054:resource busy and acquire with nowait specified解决方法
    查看用户建立详细原语句
    dbtool部署
    启动uiautomatorview 提示无法初始化主类
    运行虚拟机报错:CPU acceleration status: HAXM is not installed on this machine
    Appium-Python-Windows 环境搭建
    Vagrant安装Docker
    XPath
    Selenium之元素定位
  • 原文地址:https://www.cnblogs.com/smartsmile/p/6234020.html
Copyright © 2020-2023  润新知