
h5
黑豆1024
这个作者很懒,什么都没留下…
展开
-
本地h5页面如何在手机上预览 ---完美实现。
安装node环境。在当前所在项目文件夹下输入命令: npm install anywhere -g运行项目: anywhere此时会弹出一个地址,手机上访问这个地址就可以了。亲测有效。原文地址转载 2021-06-17 14:59:38 · 1104 阅读 · 1 评论 -
H5实现提示框
引入链接 <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script><button onclick="submit()">1111111</button> function submit() { swal("兑换码不能为空", { buttons: false, timer: 2000, }); }...转载 2021-06-17 14:56:20 · 1513 阅读 · 0 评论 -
H5移动端震动功能
判断兼容浏览器对振动API的支持情况,一个好的习惯就是在使用之前要检查一下当前你的应用环境、浏览器是否支持振动API。下面就是检测的方法:setTimeout(()=>{ navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; if(navigator.vibrate) { console.log(转载 2021-06-01 17:16:01 · 1138 阅读 · 0 评论