没有合适的资源?快使用搜索试试~ 我知道了~
camera api (含图片预览) 参考地址 主要为利用input type=file, accept="image/*" 进行处理 图片预览方式(两种) const file = e.target.files[0] // 方式1 const url1 = window.URL.createObjectURL(file); let url2 // 方式2 const reader = new FileReader(); reader.onload = (e) => { url2 = e.target.result; }; reader.readAsDataURL(file); t
资源推荐
资源详情
资源评论
HTML5 device access 设备访问详解设备访问详解
camera api (含图片预览含图片预览)
参考地址
主要为利用input type=file, accept="image/*" 进行处理
图片预览方式(两种)
const file = e.target.files[0] // 方式1
const url1 = window.URL.createObjectURL(file);
let url2
// 方式2
const reader = new FileReader();
reader.onload = (e) => {
url2 = e.target.result;
};
reader.readAsDataURL(file);
touch events (触屏事件触屏事件)
参考地址
touchstart
touchen
touchcancel 电话的接入或者弹出信息等比较高级的事件触发,一般做保存操作
touchmove
geolocation
参考地址
注意谷歌浏览器要https才能提供定位服务
if (navigator.geolocation){
navigator.geolocation.getCurrentPosition((position) => {
this.geolocation = `latitude:${position.coords.latitude},longitude:${position.coords.longitude}`
}, (err) => {
console.log(err);
}, {
enableHighAccuracy: true,
maximumAge : 30000, // buffer memory timre
timeout : 27000 // waiting time
})
} else {
alert('geolocation not supported!')
}
device orientation and motion
参考地址
window.addEventListener('deviceorientation',(doe) => {
this.absolute = doe.absolute //false 表示方向数据由设备本身坐标系提供
this.alpha = doe.alpha // 绕Z轴0-360 进入时手机水平正对的方向为0或360
this.beta = doe.beta // 绕X轴-180~180 描述由前向后旋转
this.gamma = doe.gamma // 绕Y轴-90~90 描述由左向右旋转
}, true)
// chrome v65 只支持accelerationIncludingGravity和interval(应该因为一些限制没有找到),其它浏览器最新版基本都支持
window.addEventListener('devicemotion', (dme) => {
this.acceleration = dme.acceleration
this.accelerationIncludingGravity = dme.accelerationIncludingGravity
this.rotationRate = dme.rotationRate
this.interval = dme.interval
}, false)
Pointer Lock(鼠标锁定鼠标锁定)
参考地址
资源评论
weixin_38726712
- 粉丝: 2
- 资源: 958
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于pytorch+OpenCV的手写数字识别源码+使用文档+全部资料(优秀项目).zip
- 基于C++和Opencv的传统手势识别源码+使用文档+全部资料(优秀项目).zip
- 与我最爱的人度过的第二个情人节,花心思制作的一个网页送给她
- Python实战:高效读取Excel数据.zip
- 历史学习网站 JAVA+Vue.js+SpringBoot+MySQL
- µ×ɼµÂ͵ƻºÍÒ¿ÏÍɼÂÎ×Á
- 基于pytorch+OpenCV的手写数字识别源码+使用文档+全部资料(优秀项目).zip
- C++ 一个 回文素数 回文素 数
- C++ 一个 回文素数 回文素 数
- 基于pytorch+OpenCV的手写数字识别源码+使用文档+全部资料(优秀项目).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功