zoukankan      html  css  js  c++  java
  • layer

    使用时引入require_layer.html即可
    范例:
    layer.open({
      type: 1, 
      skin: 'demo-class',
      area: ['500px', '300px'],
      offset: ['100px', '200px'],
      btn: ['按钮1', '按钮2', '按钮3', …],
      yes: function(index, layero){
          //do something
          layer.close(index); //如果设定了yes回调,需进行手工关闭
      }
      cancel: function(){},
      btn3: function(){},
      success: function(layero, index){  //弹窗后的回调函数
          console.log(layero, index);
      }
      end: function(){},//销毁层的回调,包括关闭、取消、确认
      content: '传入任意的文本或html' ,//这里content是一个普通的String
      shade: [0.8, '#393D49'],
      scrollbar: false,//禁止浏览器出现滚动条
      move: false,//禁止移动layer
      
    });
    layer.open({
      type: 1,
      content: $('#id') //这里content是一个DOM
    });
    //Ajax获取
    $.post('url', {}, function(str){
      layer.open({
      type: 1,
      content: str //注意,如果str是object,那么需要字符拼接。
      });
    });
     
    type表示使用“页面层”type的layer
    skin表示样式class名,可使用自己的class
    area是宽高,缺省值表示自适应
    offset是定位,缺省值表示居中
    btn是按钮,回调函数分别是yes,cancel,btn3,...
    shade是遮罩层
    time是自动关闭时间,单位ms
    id,建议设置id,使lay仅允许弹出一个
     
    最后,需要选项卡型layer时,可使用:
    layer.tab({
      area: ['600px', '300px'],
      tab: [{
        title: 'TAB1', 
        content: '内容1'
      }, {
        title: 'TAB2', 
        content: '内容2'
      }, {
        title: 'TAB3', 
        content: '内容3'
      }]
    });       
        
    我的github: https://github.com/moux1024
  • 相关阅读:
    内部类
    Tomcat 配置安装
    Eclipse转idea改设置
    MyEclipse增强代码补全
    06、自动挂载+超级守护进程+时间同步+tcpwrapper+软硬链接+日志管理
    05、ip划分+网络配置+虚拟化基础+基本路由
    04、rpm+yum+tar解压
    03、磁盘管理+swap分区创建+磁盘配额+自动挂载
    02、用户管理
    01、Linux基础命令
  • 原文地址:https://www.cnblogs.com/xd1024/p/5906818.html
Copyright © 2011-2022 走看看