上一页 1 ··· 5 6 7 8 9 10 11 下一页

2022年8月10日

文本在<textarea>中使用val换行

摘要: val = val.replace(/<br\s*\/?>/gi, "\r\n"); val = val.replace(/&lt;/gi, "<"); val = val.replace(/&gt;/gi, ">"); 阅读全文

posted @ 2022-08-10 17:09 马玉豪 阅读(106) 评论(0) 推荐(0)

promise

摘要: 原理: function PromiseFn(callBack){ try{ callBack(resolve,reject) }catch(e){ reject() } let self = this; self.resolveVal = undefined; self.rejectVal = u 阅读全文

posted @ 2022-08-10 10:00 马玉豪 阅读(24) 评论(0) 推荐(0)

2022年8月9日

画布生成验证码

摘要: draw() { // 随机数 const randomNum = (min, max) => { return parseInt(Math.random() * (max - min) + min) } // 随机颜色 const randomColor = (min, max) => { con 阅读全文

posted @ 2022-08-09 15:04 马玉豪 阅读(29) 评论(0) 推荐(0)

元素大小位置

摘要: 一偏移量: offset:offsetHeight和offsetWidth是元素在垂直和水平方向上占用的空间大小,以像素计。包括元素的高度(可见的)滚动条的高度,包含内边距,滚动条,和边框的大小。 offsetLeft和top 是元素的边框至包含元素的左边框之间的像素距离。 二客户区大小:heigh 阅读全文

posted @ 2022-08-09 10:30 马玉豪 阅读(65) 评论(0) 推荐(0)

2022年8月8日

小程序页面之间的通信

摘要: 一:onShow/onHide + localStorage // pageA let isInitSelfShow = true; Page({ data: { helloMsg: 'hello from PageA' }, onShow() { // 页面初始化也会触发onShow,这种情况可能 阅读全文

posted @ 2022-08-08 19:34 马玉豪 阅读(48) 评论(0) 推荐(0)

微信小程序页面之间参数的传递

摘要: 一:使用全局变量实现数据传递 使用方法,首先在app.js中设置全局使用的变量 //app.js App({ onLaunch: function () { // 登录 wx.login({ success: res => { // 发送 res.code 到后台换取 openId, session 阅读全文

posted @ 2022-08-08 18:04 马玉豪 阅读(3779) 评论(0) 推荐(0)

请求封装

摘要: // const app = getApp() let isDev=true;//是否开发环境 let host = 'https://xs2b.kktijian.com/api' let fileHost='https://xs2b.kktijian.com' if (isDev) { host 阅读全文

posted @ 2022-08-08 17:17 马玉豪 阅读(56) 评论(0) 推荐(0)

writing-mode 文字排列方式

摘要: writing-mode 属性定义了文本水平或垂直排布以及在块级元素中文本的行进方向。 writing-mode的属性值有:horizontal-tb,vertical-lr,vertical-rl,对应的IE下的值为:lr-tb,tb-lr,tb-rl。 .wrtmod{ margin:15px; 阅读全文

posted @ 2022-08-08 09:06 马玉豪 阅读(106) 评论(0) 推荐(0)

2022年7月30日

判断IE7

摘要: if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE7.0") { //IE7 }else{ //其他} 阅读全文

posted @ 2022-07-30 15:58 马玉豪 阅读(22) 评论(0) 推荐(0)

2022年7月28日

关于display:none的元素的高度宽度

摘要: 无法直接进行计算 阅读全文

posted @ 2022-07-28 14:46 马玉豪 阅读(27) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 下一页

导航