会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
绿谷
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
8
下一页
2019年10月27日
使用腾讯地图WebService API进行地点搜索
摘要: https://lbs.qq.com/webservice_v1/guide-suggestion.html 1. 通过jsonp方式使用 2. 如果遇到报错"请求来源未被授权, 此次请求来源域名:",不要设置域名白名单
阅读全文
posted @ 2019-10-27 11:39 绿谷
阅读(4980)
评论(0)
推荐(0)
2019年10月13日
rem.js
摘要: 可配合vscode和px2rem插件使用
阅读全文
posted @ 2019-10-13 15:05 绿谷
阅读(135)
评论(0)
推荐(0)
卡片内容切换,会先显示上一张图再切换
摘要: <div class="cart" v-show="cart"> <div class="cart-content"> <img :src="imgUrl" /> </div> </div> //显示并切换卡片内容showcart(i) { //解决不了问题 //this.imgUrl = '';
阅读全文
posted @ 2019-10-13 14:45 绿谷
阅读(280)
评论(0)
推荐(0)
卡片内容切换每次图片重新加载
摘要: 1. 一张卡片切换内容(只有一张卡片,显示不同内容) 优点:减少代码量 缺点:内容涉及图片时,更改src会重新加载图片,即使两次显示同样的内容,图片依然会重新加载,体验性不好 2. 多张卡片固定内容(卡片内容固定,显示不同卡片) 优点:不用每次都加载图片,初始渲染就写入浏览器缓存中,配合图片预加载效
阅读全文
posted @ 2019-10-13 14:34 绿谷
阅读(354)
评论(0)
推荐(0)
数据加载完毕前的页面空白
摘要: 1. 设置默认值 2. 图片懒加载 3. 骨架屏占位
阅读全文
posted @ 2019-10-13 14:24 绿谷
阅读(294)
评论(0)
推荐(0)
javascript实现图片预加载
摘要: function load(url) { let imgObj = new Image(); // 创建图片对象 imgObj.src = url; if (imgObj.complete) { console.log('is loaded') } else { imgObj.onload = () => { console.log('loading success') }; imgObj.one
阅读全文
posted @ 2019-10-13 14:16 绿谷
阅读(532)
评论(0)
推荐(0)
2019年9月29日
将base64转换为file
摘要: dataURLtoFile(dataurl, filename) { var arr = dataurl.split(","), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); while (n--) { u8arr[n] = bstr.charC
阅读全文
posted @ 2019-09-29 19:53 绿谷
阅读(3754)
评论(0)
推荐(0)
javascript截取视频第一帧
摘要: <input type="file" id="upload-ipt" @change="chooseVideo" accept="video/*" /> <div id="box" style="display:none"></div> chooseVideo(e) { var that = this; var obj_file = document.getElementById("upload-
阅读全文
posted @ 2019-09-29 19:52 绿谷
阅读(7344)
评论(0)
推荐(0)
移动端视频层级解决方法
摘要: IOS端:完美解决 移动端微信: 解决遮挡问题,但是点击播放会拉伸网页然后全屏播放,体验不好 移动端浏览器:引用第三方插件jsmpeg.js将ts格式的视频转成canvas,但在IOS和低性能安卓卡顿严重
阅读全文
posted @ 2019-09-29 19:37 绿谷
阅读(1621)
评论(0)
推荐(0)
2019年9月22日
在textarea中插入图片
摘要: 设置div的contenteditable属性为true可以模仿富文本
阅读全文
posted @ 2019-09-22 14:52 绿谷
阅读(5252)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
8
下一页
公告