Open cccreator opened 6 years ago
layer是web弹层组件;
//询问框
layer.confirm('您是如何看待前端开发?', {
btn: ['重要','奇葩'] //按钮
}, function(){
layer.msg('的确很重要', {icon: 1});
}, function(){
layer.msg('真的很奇葩', {
time: 20000, //20s后自动关闭
btn: ['明白了', '知道了']
});
});
//提示层
layer.msg("玩命提示中",{icon:6,time:2000});
//icon样式是6,关闭时间为2秒。
Date() 返回当天日期和时间;如:
document.write(new Date())
会返回 Sat Mar 10 2018 22:45:37 GMT+0800getDate()方法返回月份中的某一天(1-31号的某一天);如
document.write(new Date().getDate())
会返回 10getDay()方法返回一个周的某一天(0(周日)-6(周六)的某一天);如
document.write(new Date().getDay())
会返回 6getMonth()方法返回表示月份的数字;如
document.write(new Date().getMonth()
会返回 3getFullYear()方法可返回一个表示年份的数字;如
document.write(new Date().getFullYear())
会返回 2018getHours()方法可返回一个表示小时的字段;getMinutes()方法可返回一个表示分钟的字段;getSeconds()方法可返回一个表示秒的字段;如
会返回 23.11.20
getTime()方法可返回一个距离1970年1月1日的毫秒数字;如
document.write(new Date().getTime())
会返回 1520694883577setDay()方法用于设置一个月的某一天;如
会返回 Fri Mar 16 2018 23:19:36 GMT+0800