摘要: HTML代码: <input id="file" type="file"> JS代码: var eleFile = document.querySelector('#file'); // 压缩图片需要的一些元素和对象 var reader = new FileReader(), img = new 阅读全文
posted @ 2019-03-12 09:58 web前端参天大圣 阅读(1088) 评论(0) 推荐(0) 编辑
摘要: CSS代码: .clip { position: absolute; clip: rect(0 0 0 0); } HTML代码: <input type="file" id="uploadFile" class="clip" accept="image/*"> <label class="ui-b 阅读全文
posted @ 2019-03-12 09:57 web前端参天大圣 阅读(977) 评论(0) 推荐(0) 编辑
摘要: 案例地址:https://zhangxinxu.github.io/https-demo/cache/start.html 我们直接看一个例子吧,如下HTML和JS代码: 阅读全文
posted @ 2019-03-12 09:51 web前端参天大圣 阅读(3344) 评论(0) 推荐(0) 编辑
摘要: // 获得权限 Notification.requestPermission(); // 点击按钮 document.querySelector('#button').addEventListener('click', function () { new Notification("Hi,帅哥:", { body: '可以加你为好友吗?', icon: 'h... 阅读全文
posted @ 2019-03-12 09:47 web前端参天大圣 阅读(1050) 评论(0) 推荐(0) 编辑
摘要: HTML代码: 有人想加你为好友 JS代码: if (window.Notification) { var button = document.getElementById('button'), text = document.getElementById('text'); var popNotice = function() { if (Notific... 阅读全文
posted @ 2019-03-12 09:41 web前端参天大圣 阅读(896) 评论(0) 推荐(0) 编辑