layer插件移动端弹出框示例

来源:互联网 发布:国家网络应急中心考试 编辑:程序博客网 时间:2024/04/28 21:42

// layer插件移动端弹出框示例
//信息框  layer.open({    content: '移动版和PC版不能同时存在同一页面'    ,btn: '我知道了'  });    //提示  layer.open({    content: 'hello layer'    ,skin: 'msg'    ,time: 2 //2秒后自动关闭  });  layer.open({    content: '修改密码成功',skin: 'msg',time: 2,end : function () {// 页面跳转localStorage.removeItem("mas_user");var url = commonAjax.defaultOption.mas_url.replace("{0}",1);window.location.href = url;} });  //询问框  layer.open({    content: '您确定要刷新一下本页面吗?'    ,btn: ['刷新', '不要']    ,yes: function(index){      location.reload();      layer.close(index);    }  });    //底部对话框  layer.open({    content: '这是一个底部弹出的询问提示'    ,btn: ['删除', '取消']    ,skin: 'footer'    ,yes: function(index){      layer.open({content: '执行删除操作'})    }  });    //底部提示  layer.open({    content: '一个没有任何按钮的底部提示'    ,skin: 'footer'  });    //自定义标题风格  layer.open({    title: [      '我是标题',      'background-color: #FF4351; color:#fff;'    ]    ,content: '标题风格任你定义。'  });    //页面层  layer.open({    type: 1    ,content: '可传入任何内容,支持html。一般用于手机页面中'    ,anim: 'up'    ,style: 'position:fixed; bottom:0; left:0; width: 100%; height: 200px; padding:10px 0; border:none;'  });    //loading层  layer.open({type: 2});    //loading带文字  layer.open({    type: 2    ,content: '加载中'  });



原创粉丝点击