layer框架一些简单的

$('#id_1').on('click',function(){
  layer.msg('不开心',{icon:5}); //icon从0-6
});
$('#id_2').on('click',function(){
  // layer.alert('不开心');
  // layer.alert('见到你真好',{icon:1,skin:'layui-layer-imgbar'});  //信息,图标,皮肤
  layer.alert('见到你真好',{icon:1,skin:'layui-layer-molv'});
});
$('#id_3').on('click',function(){
  // layer.alert('见到你真好',{icon:1});
  var index = layer.load(0,{shade:[0.1,'#fff']});  //暂缓画面0表示画面图片,可设0-3,透明度,背景色
  setTimeout(function(){layer.close(index);},1000); //暂缓时间
});
$('#id_4').on('click',function(){
  layer.open({
    // title:'警告',
    type:1,
    area:['500px','160px'],
    shadeClose:true,
    // content:"自定义内容",
    content:"<i>自定义内容</i>",
  });
});
$('#id_5').on('click',function(){
  layer.open({
    type:2,
    title:'子操作',
    maxmin:true,  //可放大子弹出网页
    area:['800px','500px'],
    shadeClose:true, //点击遮蔽关闭层
    content:"demo3.html",
  });
});

猜你喜欢

转载自www.cnblogs.com/ksy-c/p/8907944.html